Skip to content

Instantly share code, notes, and snippets.

Created January 2, 2017 20:34
Show Gist options
  • Save anonymous/5500448ec3b8ec2e16153bc37a3c5a91 to your computer and use it in GitHub Desktop.
Save anonymous/5500448ec3b8ec2e16153bc37a3c5a91 to your computer and use it in GitHub Desktop.
Do we need GraphQL?
POST /graphql
Content-Type: application/graphql
{
post(id: 1) {
id
title
comments {
id
body
}
}
}
GET /api/posts/1?include=comments
Accept: application/vnd.api+json
// Our second client needs a `published_at`
POST /graphql
Content-Type: application/graphql
{
post(id: 1) {
id
title
comments {
id
body
}
}
}
// Our second client needs a `published_at`
POST /graphql
Content-Type: application/graphql
{
post(id: 1) {
id
title
published_at // This changes our cache key
comments {
id
body
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment