-
-
Save kellysutton/aeb96e187f344beed28b0310df1a8d19 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
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 | |
} | |
} | |
} |
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 | |
published_at | |
comments { | |
id | |
body | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment