4 ms·
I'm about to start re-writing an api as GraphQL, I'm looking at the comments of support for Apollo, and looking at their webpage, but I'm failing to see what th
by pedalpete 10y ago
I'm about to start re-writing an api as GraphQL, I'm looking at the comments of support for Apollo, and looking at their webpage, but I'm failing to see what the real benefit is.
What is the problem with GraphQL that they are addressing?
- jives 10y agoApollo Client doesn't solve problems with GraphQL, it provides a client for GraphQL.
- pedalpete 10y agoThanks Jives, but that still doesn't really help, does it? GraphQL from a client side are just json requests/responses, right? Am I missing something else?
- igl 10y agoMy favorites are the collection of functions offered by the graphql-tools package. Like composing your schema from strings instead of the verbose JSON definition. The mocking is also neat. Apollo is really just a tool-box of a lot neat little things that you can put together or omit. Check out their other packages beside apollo-client.
- foota 10y agoFrom what I can tell, Relay and Apollo serve as an implementation of functions you'd need to write to organize the fetching of your data on the client side. It turns things like "oh, in componentDidMount I need to fetch a route and update that data inside the store I'm using" into "Hey Relay this component needs this data before it loads". Relay I think is a more opinionated and heavier weight option, with the benefit provided being that it intelligently aggregates queries based off fragments and allegedly handles caching (minus invalidation, so you could argue that it doesn't really handle it ;) ) Fwiw in the project I'm working on now we judged that the extra complexity of a data fetching layer like Relay or Apollo wasn't worth it for us. We may have come to a different conclusion with a different project. Ymmv