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
a0ca29b2
Commit
a0ca29b2
authored
Mar 11, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add resolver note to calls-gitaly section
parent
be5d6507
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
doc/development/api_graphql_styleguide.md
doc/development/api_graphql_styleguide.md
+22
-0
No files found.
doc/development/api_graphql_styleguide.md
View file @
a0ca29b2
...
...
@@ -392,6 +392,28 @@ field :blob, type: Types::Snippets::BlobType,
This will increment the
[
`complexity` score
](
#field-complexity
)
of the field by
`1`
.
If a resolver calls Gitaly, it can be annotated with
`BaseResolver.calls_gitaly!`
. Doing this will pass
`calls_gitaly: true`
to any
field that uses this resolver.
For example:
```
ruby
class
BranchResolver
<
BaseResolver
type
::
Types
::
BranchType
,
null:
true
calls_gitaly!
argument
name:
::
GraphQL
::
STRING_TYPE
,
required:
true
def
resolve
(
name
:)
object
.
branch
(
name
)
end
end
```
Then when we use it, any field that uses
`BaseResolver`
will have the correct
value for
`calls_gitaly:`
.
### Exposing permissions for a type
To expose permissions the current user has on a resource, you can call
...
...
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