Last active
June 7, 2019 18:09
-
-
Save sarahsweat/a9954a9b032afd86e9cd3115f5fa1ea6 to your computer and use it in GitHub Desktop.
This file contains 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 'apollo-boost' | |
const RECIPE_ATTRIBUTES = gql` | |
fragment recipeResults on Recipe { | |
id | |
title | |
directions | |
ingredients | |
bylines { | |
id | |
title | |
imageUrl | |
} | |
image { | |
id | |
title | |
url | |
} | |
} | |
` | |
export const GET_RECIPE = gql` | |
query Search($id: String!) { | |
search(q: $id, brand: FOOD, types: RECIPE) { | |
results { | |
...recipeResults | |
} | |
} | |
} | |
${RECIPE_ATTRIBUTES} | |
` | |
export const GET_RECIPES = gql` | |
query Search($searchInput: String!) { | |
search(q: $searchInput, brand: FOOD, types: RECIPE, limit: 50) { | |
count | |
pageInfo { | |
endCursor | |
hasNextPage | |
} | |
results { | |
...recipeResults | |
} | |
} | |
} | |
${RECIPE_ATTRIBUTES} | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment