Skip to content

Instantly share code, notes, and snippets.

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