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
b2f24d25
Commit
b2f24d25
authored
Dec 02, 2021
by
Natalia Tepluhina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ID requirement to GraphQL docs
parent
a3d95d99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
doc/development/fe_guide/graphql.md
doc/development/fe_guide/graphql.md
+34
-0
No files found.
doc/development/fe_guide/graphql.md
View file @
b2f24d25
...
...
@@ -171,6 +171,40 @@ import { getIdFromGraphQLId } from '~/graphql_shared/utils';
const
primaryKeyId
=
getIdFromGraphQLId
(
data
.
id
);
```
**It is required**
to query global
`id`
for every GraphQL type that has an
`id`
in the schema:
```
javascript
query
allReleases
(...)
{
project
(...)
{
id
// Project has an ID in GraphQL schema so should fetch it
releases
(...)
{
nodes
{
// Release has no ID property in GraphQL schema
name
tagName
tagPath
assets
{
count
links
{
nodes
{
id
// Link has an ID in GraphQL schema so should fetch it
name
}
}
}
}
pageInfo
{
// PageInfo no ID property in GraphQL schema
startCursor
hasPreviousPage
hasNextPage
endCursor
}
}
}
}
```
## Immutability and cache updates
From Apollo version 3.0.0 all the cache updates need to be immutable. It needs to be replaced entirely
...
...
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