13 - Declarative directives
Learn how to use declarative directives to modify GraphQL data and see the connection updating automatically, without the need to refetch or write an updater function.
Exercise
Extras
Code Helpers
PostCreateMutation
mutation PostCreateMutation($input: PostCreateInput!, $connections: [ID!]!) {
PostCreate(input: $input) {
success
error
postEdge @appendEdge(connections: $connections) {
node {
id
content
author {
name
}
}
}
}
}
Getting the connection id
// select __id in the connection (see Feed_query)
const connectionID = posts.__id;
// OR
const connectionID = ConnectionHandler.getConnectionID(ROOT_ID, 'Feed_posts');
Your user token
The replacement for pnpm get-token. It logs you in as Sibelius Seraphini.
JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InUxIn0.relay-workshop