Created
December 8, 2021 18:56
-
-
Save twof/fd04ca8ac659bf872433c7cab790d2a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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