Skip to content

Instantly share code, notes, and snippets.

@thulioph
Created January 21, 2019 20:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thulioph/6aac6eb86eaeb96f38c244917ee45902 to your computer and use it in GitHub Desktop.
Save thulioph/6aac6eb86eaeb96f38c244917ee45902 to your computer and use it in GitHub Desktop.
import gql from 'graphql-tag';
const USER_FRAGMENT = {
account: gql`
fragment AccountDetails on FinancialUserType {
id
username
email
firstName
lastName
photoUrl
firebaseUid
}
`,
events: gql`
fragment EventsDetails on EventType {
id
dateFrom
dateTo
category
description
users {
id
firstName
lastName
photoUrl
}
}
`,
};
export {
USER_FRAGMENT
};
import gql from 'graphql-tag';
import { USER_FRAGMENT } from 'graphql/fragments';
const ALL_USERS_QUERY = gql`
query AllUsersQuery($month: Int!, $year: Int!) {
allUsers(month: $month, year: $year) {
id,
workingDays,
account {
...AccountDetails
},
salary {
...SalaryDetails
},
events {
...EventsDetails
},
expenses {
...ExpensesDetails
},
status {
...StatusDetails
},
}
}
${USER_FRAGMENT.account}
${USER_FRAGMENT.salary}
${USER_FRAGMENT.events}
${USER_FRAGMENT.expenses}
${USER_FRAGMENT.status}
`;
export {
ALL_USERS_QUERY,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment