Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ca7f3f3e
Commit
ca7f3f3e
authored
Nov 27, 2019
by
James Tharpe
Committed by
Evan Read
Nov 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify authorization, remove resolvers docs
Resolvers docs aren't relevant to client dev, redundent w/ syleguide
parent
263e8ac4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
43 deletions
+18
-43
doc/api/graphql/getting_started.md
doc/api/graphql/getting_started.md
+18
-43
No files found.
doc/api/graphql/getting_started.md
View file @
ca7f3f3e
...
...
@@ -22,8 +22,8 @@ to use as a bearer token.
Example:
```
sh
GRAPHQL_TOKEN
=
<your-token>
curl
'http
://gitlab.com/api/graphql'
--header
"Authorization: Bearer
$GRAPHQL_TOKEN
"
--header
"Content-Type: application/json"
--request
POST
--data
"{
\"
query
\"
:
\"
query {currentUser {name}}
\"
}
GRAPHQL_TOKEN
=
<your-token>
curl
'http
s://gitlab.com/api/graphql'
--header
"Authorization: Bearer
$GRAPHQL_TOKEN
"
--header
"Content-Type: application/json"
--request
POST
--data
"{
\"
query
\"
:
\"
query {currentUser {name}}
\"
}"
```
### GraphiQL
...
...
@@ -92,12 +92,11 @@ query {
title
}
}
}
}
```
###
The root node
###
Graph traversal
Any field defined in
[
`QueryType`
](
https://gitlab.com/gitlab-org/gitlab/tree/master/app/graphql/types/query_type.rb
)
will be exposed as a root node.
When retrieving child nodes use:
-
the
`edges { node { } }`
syntax.
...
...
@@ -121,32 +120,14 @@ query {
}
```
More on schema definitions:
[
graphql-ruby docs
](
https://graphql-ruby.org/schema/definition
)
More about queries:
[
GraphQL docs
](
https://graphql.org/learn/queries/
)
and
[
graphql-ruby docs
](
https://graphql-ruby.org/queries/executing_queries
)
[
GraphQL docs
](
https://graphql.org/learn/queries/
)
### Authorization
Authorization uses the same engine as the Rails app. So if you've signed in to GitLab
and use GraphiQL, all queries will be performed as you, the signed in user.
See the
[
authorization section
](
../../development/api_graphql_styleguide.html#authorization
)
of the StyleGuide
for implementation details.
### Resolvers
A resolver is how we define how the records requested by the client are retrieved, collected,
and assembled into the response.
The
[
GraphQL API StyleGuide
](
../../development/api_graphql_styleguide.md#resolvers
)
has more details
about the implementation of resolvers.
More about resolvers:
[
GraphQL Docs
](
https://graphql.org/learn/execution/
)
and
[
graphql-ruby docs
](
https://graphql-ruby.org/fields/resolvers.html
)
Authorization uses the same engine as the GitLab application (and GitLab.com). So if you've signed in to GitLab
and use GraphiQL, all queries will be performed as you, the signed in user. For more information, see the
[
GitLab API documentation
](
../README.md#authentication
)
.
### Mutations
...
...
@@ -253,12 +234,8 @@ You should get something like the following output:
We've asked for the note details, but it doesn't exist anymore, so we get
`null`
.
The
[
GraphQL API StyleGuide
](
../../development/api_graphql_styleguide.md#mutations
)
has more details
about implementation of mutations.
More about mutations:
[
GraphQL Docs
](
https://graphql.org/learn/queries/#mutations
)
and
[
graphql-ruby docs
](
https://graphql-ruby.org/mutations/mutation_classes.html
)
[
GraphQL Docs
](
https://graphql.org/learn/queries/#mutations
)
.
### Introspective queries
...
...
@@ -301,8 +278,7 @@ query IssueTypes {
```
More about introspection:
[
GraphQL docs
](
https://graphql.org/learn/introspection/
)
and
[
graphql-ruby docs
](
https://graphql-ruby.org/schema/introspection.html
)
[
GraphQL docs
](
https://graphql.org/learn/introspection/
)
## Sorting
...
...
@@ -382,5 +358,4 @@ query {
```
More on pagination and cursors:
[
GraphQL docs
](
https://graphql.org/learn/pagination/
)
and
[
graphql-ruby docs
](
https://graphql-ruby.org/relay/connections.html#cursors
)
[
GraphQL docs
](
https://graphql.org/learn/pagination/
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment