Skip to content

Instantly share code, notes, and snippets.

@dbayarchyk
Last active September 18, 2019 14:00
Show Gist options
  • Save dbayarchyk/e19ae7ce3fbc8759814bad3565a0d247 to your computer and use it in GitHub Desktop.
Save dbayarchyk/e19ae7ce3fbc8759814bad3565a0d247 to your computer and use it in GitHub Desktop.
GraphQL fragment-based approach to building your components - Comment/fragments.ts
import gql from 'graphql-tag';
import * as UserInfo from 'UserInfo/fragments';
export const comment = gql`
fragment Comment_comment on Comment {
 content
 author {
  ...UserInfo_user
 }
}
${UserInfo.user}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment