Guest User

Untitled

a guest
May 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // PARENT
  2.  
  3. const query = graphql.experimental`
  4. query MyRootComponentQuery($employeeId: String!, $includeOvertime: Boolean) {
  5. employee(id: $employeeId) {
  6. fullName
  7. ...MyFragmentComponent_employee @arguments(includeOvertime: $includeOvertime)
  8. }
  9. }
  10. `
  11.  
  12. // CHILD
  13.  
  14. const fragments = {
  15. employee: graphql.experimental`
  16. fragment MyFragmentComponent_employee on Employee
  17. @argumentDefinitions(includeOvertime: { type: "Boolean", defaultValue: false }) {
  18. hoursWorked(includeOvertime: $includeOvertime)
  19. dob
  20. fullName
  21. id
  22. }
  23. `,
  24. }
Add Comment
Please, Sign In to add comment