4 ms·
What kind of client side support do you need? You send a query document in a POST and get JSON back. I'm pretty sure all languages have an http client and a jso
by dudul 6y ago
What kind of client side support do you need? You send a query document in a POST and get JSON back. I'm pretty sure all languages have an http client and a json library.
How is pagination worse than the REST equivalent?
I guess I could see a case for client side caching based on IDs, but unless you couple this with subscriptions thats kind of brittle.
- georgyo 6y agoThe main different on pagination, is that you pages return inside an object. And you have have several different objects that all have different pages. With rest, you can only paginate that particular call. You cannot really paginate different results in that one call. At most you can do is say get the list of objects at this endpoint. And that is far easier to grok than graphql's pagination in even the simple case. I mean, just look at the official guide on this: https://graphql.org/learn/pagination/ https://graphql.org/learn/pagination/ And that only covers a simple use case!
- balfirevic 6y ago> With rest, you can only paginate that particular call. You cannot really paginate different results in that one call. Where did you get this idea that REST in any way dictates how you do pagination?
- dudul 6y agoI've implemented the connection spec many times and I find it very clear and usable. Graphql allows you to paginate several collections in the same call, but you certainly don't have to. You can do just like REST and do one at a time.
- andrewingram 6y agoDunno if it'll help at all, but I did write a thing about GraphQL connections that may clear up some things: https://andrewingram.net/posts/demystifying-graphql-connections/ https://andrewingram.net/posts/demystifying-graphql-connecti...