Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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