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
54007368
Commit
54007368
authored
Dec 04, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Laziness to graphql api guide
parent
f979f658
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
doc/development/api_graphql_styleguide.md
doc/development/api_graphql_styleguide.md
+16
-0
No files found.
doc/development/api_graphql_styleguide.md
View file @
54007368
...
...
@@ -1702,3 +1702,19 @@ For guidance, see the [GraphQL API](documentation/graphql_styleguide.md) page.
## Include a changelog entry
All client-facing changes
**must**
include a
[
changelog entry
](
changelog.md
)
.
## Laziness
One important technique for managing performance that is unique to GraphQL is
using
**lazy**
values. These are values that represent the promise of a result,
allowing their action to be run later. This enables batching of queries in
different parts of the query tree. The main example of this in our code is
the
[
GraphQL BatchLoader
](
graphql_guide/batchloader.md
)
.
If you need to manage lazy values directly, then please see
`Gitlab::Graphql::Lazy`
, and in particular
`Gitlab::Graphql::Laziness`
, which
contains
`#force`
and
`#delay`
which help implement the basic operations of
creation and elimination of laziness, where needed.
For dealing with lazy values without forcing them, use
`Gitlab::Graphql::Lazy.with_value`
.
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