Last active
May 1, 2017 18:36
-
-
Save brianlovin/658b53219b49e442ab8ba8a3a26c7249 to your computer and use it in GitHub Desktop.
Trying to abstract graphQL fragments
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
import { gql } from 'react-apollo'; | |
import { userFragments } from './user' | |
export const frequencyFragments = { | |
frequencySubscribers: gql` | |
fragment frequencySubscribers on Frequency { | |
subscriberConnection { | |
pageInfo { | |
hasNextPage | |
hasPreviousPage | |
} | |
edges { | |
node { | |
...userInfo | |
} | |
} | |
} | |
} | |
${userFragments.userInfo} | |
` | |
} |
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
import { gql } from 'react-apollo'; | |
export const userFragments = { | |
userInfo: gql` | |
fragment userInfo on User { | |
uid | |
photoURL | |
displayName | |
username | |
} | |
` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment