Skip to content

Instantly share code, notes, and snippets.

@brianlovin
Last active May 1, 2017 18:36
Show Gist options
  • Save brianlovin/658b53219b49e442ab8ba8a3a26c7249 to your computer and use it in GitHub Desktop.
Save brianlovin/658b53219b49e442ab8ba8a3a26c7249 to your computer and use it in GitHub Desktop.
Trying to abstract graphQL fragments
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}
`
}
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