Hacker News new | ask | show | jobs
by austinhutch 2049 days ago
I very much appreciate the author's approach, and giving a sober perspective on GraphQL. Working within the Shopify ecosystem, they have invested heavily in GraphQL and I don't like the UX, nor do I find the reasoning to promote it over REST particularly convincing. It has been much more difficult to grok GraphQL over REST and I don't think I'm alone.

There are likely specific use cases where GraphQL > REST but the barrier to entry is so much higher that I think you'll continue to see the interest wane[1] unless something dramatic changes

[1](https://trends.google.com/trends/explore?date=today%205-y&ge...)

4 comments

I honestly don't think there are any use cases where GraphQL > REST. It's just a new format they convinced people to build new backend layers in, and since those tools are new, some of them do address longstanding db-admin useability issues. But GraphQL as a spec is not revolutionary. It is simply a proposed structure, more constrained than REST. GraphQL is a form of REST.

Perhaps the benefit is what ryanar writes here [1], that it exposes a useable db-admin UI to front-end teams. It seemed to me this could have been achieved with something based on REST but maybe I'm just not thinking it through.

Now that I think more, it wouldn't really be sufficient to produce SQL for a front end team because you don't want them to be able to create inefficient queries.

I guess my main gripe was that GraphQL uses POST requests and nobody told me how this makes cdn caching harder so I started hating on GraphQL :-/

[1] https://news.ycombinator.com/item?id=25015221

Do you have ideas on how the situation could be improved at Shopify? What makes it hard to understand? What's missing?
I think there is some difficulty specific to Shopify here, as REST APIs go their original one was fairly sane and provided powerful features.

When their GraphQL API was released its data structures were similar but not identical to the REST API and some very important fields and features were missing which translated to a "90%" adoption by developers who needed those missing pieces. Additionally (and somewhat in keeping with points in the article,) they also introduced API versioning at this time which added a good amount of friction within the community.

More generally the issue with Shopify's GraphQL APIs is its lacking features (eg, list totals, offset pagination, object fields) which are (or had been) particularly important to the ecommerce domain and they've struggled to provide any meaningful alternatives.

As an example, developers working with ecommerce applications often have to process data en masse (fulfillments, inventory, etc..) and with the Shopify REST API and it's offset pagination these tasks were trivial to parallelise by simply chunking the workload based on the pagination method. In the GraphQL API offset pagination was removed in favour of cursor pagination which has no reasonable alternative to parallelise tasks in the same way, this requires developers to rewrite core logic and services for what may have previously been a very acceptable, efficient and most importantly working application.

The issue with Shopify's GraphQL API is not GraphQL itself, but rather the implementation of the API not meeting the requirements of the consumer - and the fact that those consumers were forced to switch to a different API without feature or even conceptual parity didn't promote feelings of joy or glee about the situation.

Personally I think their push for GraphQL was due to internal operational issues and their need for a more efficient system. This has been seen in their reasoning for reducing the timeout of an API used to fetch shipping options (from 10 seconds to 5 seconds) in preparation for Black Friday / Cyber Monday sales events, their announcement provided some developers less than a single business day to respond to the changes[1] which were dropped after community backlash and then changed to address the feedback.

[1] https://community.shopify.com/c/Shopify-APIs-SDKs/Changes-to...

I would dare to disagree. We also work quite a lot with Shopify API. First - Shopify REST API was pretty good. Second if you know how to work with REST, then I do not understand what is more difficult with GraphQL? Third, from our experience even Project managers, QA's and other less technical people use Shopify GrpahQL explorer more because it way more easily accessible and easier to work with. But also would love to hear your struggles with Shopify GraphQL
To be fair pretty much all interest in technology is waning atm, likely as a result of COVID+Holiday. Unless you think TypesScript, VSCode, and PosgreSQL are also dying. https://trends.google.com/trends/explore?date=today%205-y&ge...