Skip to content

Instantly share code, notes, and snippets.

@trevorblades
Created October 24, 2019 04:39
Show Gist options
  • Select an option

  • Save trevorblades/380c99fae4bc445a9382b7a85eb7550e to your computer and use it in GitHub Desktop.

Select an option

Save trevorblades/380c99fae4bc445a9382b7a85eb7550e to your computer and use it in GitHub Desktop.
import gql from 'graphql-tag';
export const PROJECT_FRAGMENT = gql`
fragment ProjectFragment on Project {
id
name
updatedAt
}
`;
export const FOLDER_FRAGMENT = gql`
fragment FolderFragment on Folder {
id
name
projects {
...ProjectFragment
}
}
${PROJECT_FRAGMENT}
`;
export const HOME_PAGE_QUERY = gql`
{
folders {
...FolderFragment
}
projects(filter: {folderId: null}) {
...ProjectFragment
}
}
${FOLDER_FRAGMENT}
${PROJECT_FRAGMENT}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment