3 ms·
> everyone else uses GraphQL incorrectly Quite a hot take but I can't disagree. I was one of the people using GraphQL incorrectly for the longest time. I alway
by deepfriedrice 3y ago
> everyone else uses GraphQL incorrectly
Quite a hot take but I can't disagree. I was one of the people using GraphQL incorrectly for the longest time. I always knew something was off, that we might as well have just been using rest, but could never really articulate it.
Alan's article is a great read, thanks for sharing.
- satvikpendem 3y agoIndeed, I used to use Apollo for quite a while and started asking myself why I was doing this to myself, the benefits didn't seem that clear. But someone mentioned to me on /r/GraphQL about how Relay is the correct way, as Facebook initially envisioned, and once I learned it, I was hooked. Sadly, Relay usage is 1/100 the size of Apollo, even though it is literally the way GraphQL was meant to be used, so I try to talk about it wherever I can. It really is such a simple concept (list out all of the data that you need for a given part of the app, then let the compiler manage these dependencies) that is only now starting to be used in other areas, such as the GraphQL Codegen tool: https://the-guild.dev/blog/unleash-the-power-of-fragments-with-graphql-codegen https://the-guild.dev/blog/unleash-the-power-of-fragments-wi.... It's still more incomplete and not as powerful but hopefully we can start integrating fragment stitching into the mainline GraphQL entities so that everyone benefits from this approach. It really reminds me of Vim, it started off being one of the best ways to write, and now 20 years later we have other editors reinventing the wheel to get closer to the Vim philosophy.
- Exuma 3y agoWhat are the main headaches and downsides of the apollo method? i was just at this fork in the road on something i was working on
- satvikpendem 3y agoI just replied to your other comment but definitely check out the article I mentioned: https://alan.norbauer.com/articles/relay-style-graphql https://alan.norbauer.com/articles/relay-style-graphql It's not so much downsides of Apollo, more so that it could be done better. Apollo does have things like the n+1 problem which are not present in Relay, so that could be considered a headache as it's annoying to solve if not using Relay.