-
-
Save freiksenet/41fcce20616f765625f913c5c1c15d29 to your computer and use it in GitHub Desktop.
This file contains 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 coming to gateway | |
query( | |
$id: ID! # overriden in parameters, so it won't be included | |
) { | |
node(id: $id) { # delegate to userById | |
# This is a selection set from the node resolver | |
id # This field doesn't exist in User | |
...BlogFragment # Blog can't be spread here | |
...UserFragment | |
} | |
} | |
# This fragment is used, so should be included | |
fragment UserFragment on User { | |
username | |
} | |
# This fragment isn't used, so should be removed | |
fragment BlogFragment on Blog { | |
title | |
} |
This file contains 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 sent to service | |
query( | |
$_v0_id: ID! # generated variable name | |
) { | |
userById(id: $_v0_id) { | |
...UserFragment | |
} | |
} | |
fragment UserFragment on User { | |
username | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment