I love the idea of GraphQL and Apollo, but there are two things that I am not sure about.
Jeff Whelpley
13

Very good points.

There’s this example comparing a REST and GraphQL data layer in Angular 2 (https://github.com/robzhu/graphql-demo/blob/master/Angular2App/src/shared/data.service.ts). There you can see by looking at the code comparing:

1 ) Using authors endpoint. Fetching authors data and then books thus involving a long list of ajax calls… Not to forget the endpoint may fetch data you don’t need as they are usually generic (authors, books).

2) Using a specific endpoint to get all data (and only the data you need) at once at the cost of the backend development team to build it.

3) Using GraphQL to get all data (and only the data you need) with a single call (same as 2) but without requiring to create a specific endpoint for every client requirement.

If you think about a fast changing complex backend data model you can see easily how changes on the backend will impact the client in the REST version of the API, even more if you use versioning in your API. GraphQL main feature is to avoid what I call REST endpoints explosion.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.