Resouce
URL
Recipe
GET /recipes/{id}
{
"id": "074ead4b87ac5f185d138d9574f8c4d6a74aadad",
"title": "Earl Grey Shortbread",
"url": http://www.foodnetwork.com/recipes/food-network-kitchen/earl-grey-shortbread,
"attribution": {
"author": {
"name": "Food Network Kitchen",
"url": http://www.foodnetwork.com/profiles/talent/food-network-kitchen,
}
},
"chef": "Food Network Kitchen",
"difficulty": "Easy",
"ingredients": [
"1/4 cup Earl Grey tea leaves" ,
"4 cups all-purpose flour" ,
"1/2 teaspoon salt" ,
"4 sticks unsalted butter, at room temperature" ,
"3 1/2 cups confectioners¿ sugar" ,
"2 teaspoons pure vanilla extract" ,
"3 tablespoons milk" ,
"Coarse sugar, for decorating"
] ,
"tags": [
http://www.foodnetwork.com/topics/cookie-recipes, »
http://www.foodnetwork.com/topics/shortbread-cookie-recipes, »
http://www.foodnetwork.com/topics/tea, »
http://www.foodnetwork.com/topics/christmas-recipes, »
http://www.foodnetwork.com/topics/holiday, »
],
"time": {
"Active": "25 min" ,
"Total": "3 hr"
},
"yield": "about 50 cookies"
}
{
"id": "074ead4b87ac5f185d138d9574f8c4d6a74aadad",
"title": "Earl Grey Shortbread",
"url": http://www.foodnetwork.com/recipes/food-network-kitchen/earl-grey-shortbread,
"attribution": {
"author": {
"name": "Food Network Kitchen",
"url": http://www.foodnetwork.com/profiles/talent/food-network-kitchen,
}
},
"chef": "Food Network Kitchen",
"difficulty": "Easy",
"ingredients": [
"1/4 cup Earl Grey tea leaves" ,
"4 cups all-purpose flour" ,
"1/2 teaspoon salt" ,
"4 sticks unsalted butter, at room temperature" ,
"3 1/2 cups confectioners¿ sugar" ,
"2 teaspoons pure vanilla extract" ,
"3 tablespoons milk" ,
"Coarse sugar, for decorating"
] ,
"tags": [
http://www.foodnetwork.com/topics/cookie-recipes, »
http://www.foodnetwork.com/topics/shortbread-cookie-recipes, »
http://www.foodnetwork.com/topics/tea, »
http://www.foodnetwork.com/topics/christmas-recipes, »
http://www.foodnetwork.com/topics/holiday, »
],
"time": {
"Active": "25 min" ,
"Total": "3 hr"
},
"yield": "about 50 cookies"
}
All I want
{
"id": "074ead4b87ac5f185d138d9574f8c4d6a74aadad",
"title": "Earl Grey Shortbread",
"url": http://www.foodnetwork.com/recipes/food-network-kitchen/earl-grey-shortbread
}
{
"id": "074ead4b87ac5f185d138d9574f8c4d6a74aadad",
"title": "Earl Grey Shortbread",
"url": http://www.foodnetwork.com/recipes/food-network-kitchen/earl-grey-shortbread,
"attribution": {
"author": {
"name": "Food Network Kitchen",
"url": http://www.foodnetwork.com/profiles/talent/food-network-kitchen,
}
},
"chef": "Food Network Kitchen",
"difficulty": "Easy",
"ingredients": [
"1/4 cup Earl Grey tea leaves" ,
"4 cups all-purpose flour" ,
"1/2 teaspoon salt" ,
"4 sticks unsalted butter, at room temperature" ,
"3 1/2 cups confectioners¿ sugar" ,
"2 teaspoons pure vanilla extract" ,
"3 tablespoons milk" ,
"Coarse sugar, for decorating"
] ,
"tags": [
http://www.foodnetwork.com/topics/cookie-recipes, »
http://www.foodnetwork.com/topics/shortbread-cookie-recipes, »
http://www.foodnetwork.com/topics/tea, »
http://www.foodnetwork.com/topics/christmas-recipes, »
http://www.foodnetwork.com/topics/holiday, »
],
"time": {
"Active": "25 min" ,
"Total": "3 hr"
},
"yield": "about 50 cookies"
}
{
"id": "074ead4b87ac5f185d138d9574f8c4d6a74aadad",
"title": "Earl Grey Shortbread",
"url": http://www.foodnetwork.com/recipes/food-network-kitchen/earl-grey-shortbread,
"attribution": {
"author": {
"name": "Food Network Kitchen",
"url": http://www.foodnetwork.com/profiles/talent/food-network-kitchen,
}
},
"difficulty": "Easy",
"ingredients": [
"1/4 cup Earl Grey tea leaves" ,
"4 cups all-purpose flour" ,
"1/2 teaspoon salt" ,
"4 sticks unsalted butter, at room temperature" ,
"3 1/2 cups confectioners¿ sugar" ,
"2 teaspoons pure vanilla extract" ,
"3 tablespoons milk" ,
"Coarse sugar, for decorating"
] ,
"tags": [
http://www.foodnetwork.com/topics/cookie-recipes, »
http://www.foodnetwork.com/topics/shortbread-cookie-recipes, »
http://www.foodnetwork.com/topics/tea, »
http://www.foodnetwork.com/topics/christmas-recipes, »
http://www.foodnetwork.com/topics/holiday, »
],
"time": {
"Active": "25 min" ,
"Total": "3 hr"
},
"yield": "about 50 cookies"
}
A query language for your application
query {
recipes(first: 2) {
title,
attribution {
author {
name
}
}
}
}
{
"data": {
"recipes": [
{
"title": "Achiote Marinated Baby Chickens...",
"attribution": {
"author": {
"name": "Aarón Sánchez"
}
}
}
]
}
}
GET /graphql
Response
export default {
recipes({ first }) {
// Arbitrary api call
return getAllRecipes('recipes', first)
},
recipeCount() {
return getTotalRecipes()
}
}
Links to learn more
https://raw.githubusercontent.com/sogko/graphql-shorthand-notation-cheat-sheet/master/graphql-shorthand-notation-cheat-sheet.png
http://graphql.org/learn/
https://developer.github.com/early-access/graphql/explorer/
http://dev.apollodata.com/tools/
https://github.com/rmosolgo/graphql-ruby