Created
January 21, 2019 20:09
-
-
Save thulioph/6aac6eb86eaeb96f38c244917ee45902 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'graphql-tag'; | |
const USER_FRAGMENT = { | |
account: gql` | |
fragment AccountDetails on FinancialUserType { | |
id | |
username | |
firstName | |
lastName | |
photoUrl | |
firebaseUid | |
} | |
`, | |
events: gql` | |
fragment EventsDetails on EventType { | |
id | |
dateFrom | |
dateTo | |
category | |
description | |
users { | |
id | |
firstName | |
lastName | |
photoUrl | |
} | |
} | |
`, | |
}; | |
export { | |
USER_FRAGMENT | |
}; |
This file contains hidden or 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 '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