What is GraphQL? GraphQL is all about data communication Somehow it reminds me of good old "The S stands for Simple": http://harmful.cat-v.org/software/xml/soap/simple
REST in Peace. Long Live GraphQL
11–20 of 94 posts
Re: REST in Peace. Long Live GraphQL
#12Re: REST in Peace. Long Live GraphQL
#13Re: REST in Peace. Long Live GraphQL
#14Re: REST in Peace. Long Live GraphQL
#15In particular, I have some FUD about how to go about rate limiting, when in theory a single request could grab every resource that the client is authorized to retrieve, and thrash the database.
Looks like Github counts/restricts the number of total nodes returned: https://developer.github.com/v4/guides/resource-limitations/
Also is there any protection against pathological requests? (e.g. if there are loops in the object graph, can I build an arbitrarily deep GraphQL query that will take an arbitrarily long time to complete?)
Re: REST in Peace. Long Live GraphQL
#16In particular, I have some FUD about how to go about rate limiting, when in theory a single request could grab every resource that the client is authorized to retrieve, and thrash the database.
Looks like Github counts/restricts the number of total nodes returned: https://developer.github.com/v4/guides/resource-limitations/
Also is there any protection against pathological requests? (e.g. if there are loops in the object graph, can I build an arbitrarily deep GraphQL query that will take an arbitrarily long time to complete?)
Re: REST in Peace. Long Live GraphQL
#17Should I give it another look? Was I too quick to dismiss it?
Re: REST in Peace. Long Live GraphQL
#18Then to read the planet’s name, we ask: GET - /planets/1 And to read the films titles, we ask: GET - /films/1 GET - /films/2 GET - /films/3 GET - /films/6 Once we have all 6 responses from the server, we can combine them to satisfy the data needed by our view. this is stupid there is no need to go multiple rounds?
GraphQL seems a lot more complicated to consume/explore than REST, and it looks like I need to know a good bit about how the data is shaped before I write a line of code - something that can change, and something that the current REST endpoint system (happily) doesn't need.
Re: REST in Peace. Long Live GraphQL
#19> The need to do multiple round trips to fetch data required by a view: With GraphQL, you can always fetch all the initial data required by a view with a single round-trip to the server. I'm not sure what's different. You can actually implement the same with plain old http api's, also.
Another benefit of graphql is that is a "lingua franka", you can use it internally, between microservices, etc.
Re: REST in Peace. Long Live GraphQL
#20> The need to do multiple round trips to fetch data required by a view: With GraphQL, you can always fetch all the initial data required by a view with a single round-trip to the server. I'm not sure what's different. You can actually implement the same with plain old http api's, also.
Especially since avoiding n+1 query situations involves hand optimizing a lot of stuff anyways. In my experience it's not really any less work than just aggregating stuff in a regular HTTP API, but it does seem to give a better developer experience on the frontend. At a certain scale, I think it could be worth the investment, but I don't think it really lives up to the hype.