Skip to content

Instantly share code, notes, and snippets.

@twof
Created December 8, 2021 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twof/fd04ca8ac659bf872433c7cab790d2a1 to your computer and use it in GitHub Desktop.
Save twof/fd04ca8ac659bf872433c7cab790d2a1 to your computer and use it in GitHub Desktop.
// Query
{
user {
cat? {
name!
age
}
}
}
// Response without CCN
{
errors: [],
data: {
user: {
cat: {
name: null,
age: 1
}
}
}
}
// Response with ! only
{
errors: [
{
locations: [{ column: 13, line: 4 }],
message: 'Cannot return null for non-nullable field User.Cat.name.',
path: ['user', 'cat', 'name'],
handledPath: undefined
}
],
data: {
user: {
cat: null
}
}
}
// Response with ! and ?
{
errors: [
{
locations: [{ column: 13, line: 4 }],
message: 'Cannot return null for non-nullable field User.Cat.name.',
path: ['user', 'cat', 'name'],
handledPath: ['user', 'cat'],
lostData: {
name: null,
age: 1
}
}
],
data: {
user: {
cat: null
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment