Skip to content

Instantly share code, notes, and snippets.

@tazsingh
Created May 26, 2017 15:49
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 tazsingh/92c0f9a92dbbe7fe8f925006f9984f51 to your computer and use it in GitHub Desktop.
Save tazsingh/92c0f9a92dbbe7fe8f925006f9984f51 to your computer and use it in GitHub Desktop.
Fragment Subscriptions - subscribeTo Extension Approach
fragment userFragment on User
subscribeTo(userAvatarChangeSubscription)
{
name
username
avatarUrl(size: 200)
avatarChangeId # can be an implicit field on this fragment added by
# the server to track subscription events on the client
}
subscription userAvatarChangeSubscription {
userAvatarChange # somehow linked to the previous fragment,
# for each occurrence of the previous fragment in its query
{
avatarUrl(size: 200)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment