News for hackers. Stuff that matters.
Re:Why not use GraphQL? by htkibar on Sunday November 08, 2020 @09:22AM (#25025959)
What feature of REST would allow you to separate your entities as they should be while being able to arbitrarily query them together?
Re:Why not use GraphQL? by balfirevic on Sunday November 08, 2020 @10:15PM (#25031137)
Feature where you can write an endpoint to return whatever it is that you need. Granted, it’s not automatic as in some GraphQL frameworks - not sure if that’s what you meant by “arbitrary”. But then again, such things are a step beyond just using GraphQL as a protocol.
Re:Why not use GraphQL? by htkibar on Monday November 09, 2020 @05:53PM (#25040956)
The comparison would be;

REST: Any time there is a new "view"; you need to go to your server and write a new endpoint.

GraphQL: You can stitch data together however you want; as long as that data is defined.

So for example if I need name of someone and the url of their children; querying it alone is enough with GraphQL whereas with REST either I need to fetch multiple times or write a new endpoint that serves both together.