Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import { gql } from 'apollo-boost'
  2.  
  3. const RECIPE_ATTRIBUTES = gql`
  4. fragment recipeResults on Recipe {
  5. id
  6. title
  7. directions
  8. ingredients
  9. bylines {
  10. id
  11. title
  12. imageUrl
  13. }
  14. image {
  15. id
  16. title
  17. url
  18. }
  19. }
  20. `
  21.  
  22. export const GET_RECIPE = gql`
  23. query Search($id: String!) {
  24. search(q: $id, brand: FOOD, types: RECIPE) {
  25. results {
  26. ...recipeResults
  27. }
  28. }
  29. }
  30. ${RECIPE_ATTRIBUTES}
  31. `
  32.  
  33. export const GET_RECIPES = gql`
  34. query Search($searchInput: String!) {
  35. search(q: $searchInput, brand: FOOD, types: RECIPE, limit: 50) {
  36. count
  37. pageInfo {
  38. endCursor
  39. hasNextPage
  40. }
  41. results {
  42. ...recipeResults
  43. }
  44. }
  45. }
  46. ${RECIPE_ATTRIBUTES}
  47. `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement