Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I never understood the point. Really don't. GraphQL does not provide any built-in mechanisms for filtering, sorting, pagination or other arbitrary transformations of the response. If you are already built those then might as well just include the data necessary and use a REST API.


It depends on whether your chosen platform can do it.

If you're coding resolvers by hand, that is not fun. But for example the Lighthouse GraphQL layer for Laravel (it's a schema-first thing based on the Webonyx PHP GraphQL reference implementation) can do a lot of this for you using schema decorations.

https://lighthouse-php.com

It has where/filter/sort/pagination, automatic scope narrowing etc., and you have very little code (if any) beyond the graphql schema to set it up. It integrates brilliantly with the Eloquent query builder.

One of the best applications for PHP IMO; it is really enormously productive.


> GraphQL does not provide any built-in mechanisms for filtering, sorting, pagination or other arbitrary transformations of the response.

GraphQL is just the protocol. It is up to implementations to add support for it. We use Hot Chocolate GraphQL server with entity framework backend, and it has built-in support for all of those things.

Vast majority of the criticism of GraphQL comes from people who do not understand it. GraphQL does have a steep learning curve.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: