Created
January 2, 2017 20:34
-
-
Save anonymous/5500448ec3b8ec2e16153bc37a3c5a91 to your computer and use it in GitHub Desktop.
Do we need GraphQL?
This file contains hidden or 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
POST /graphql | |
Content-Type: application/graphql | |
{ | |
post(id: 1) { | |
id | |
title | |
comments { | |
id | |
body | |
} | |
} | |
} |
This file contains hidden or 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
GET /api/posts/1?include=comments | |
Accept: application/vnd.api+json |
This file contains hidden or 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
// Our second client needs a `published_at` | |
POST /graphql | |
Content-Type: application/graphql | |
{ | |
post(id: 1) { | |
id | |
title | |
comments { | |
id | |
body | |
} | |
} | |
} |
This file contains hidden or 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
// 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