| The first interaction I had with GraphQL the developer who introduced tried to make it TOO smart for its own good. It was building complex SQL dynamically which means the SQL that it was running was borderline non-deterministic. (Aka. identified the foreign keys and primary keys linked them together and made all other fields options) Things I don't like about GraphQL (In Java which was my experience) 1. Debugging it is annoying. There's no clear concise way to follow the code there seems to be some magic that happens where it isn't clear when certain parts of the code get invoked. Things I like about it. 1. Lets you make multiple queries and reduce/extend the size of your payload as needed. In my view graphQL is much better when you're not constrained by a SQL like backend. It's great at filtering the payloads which is great for mobile and such. It also allows you make multiple calls in one go which also means you can shoot yourself in the foot if you over do it. I will call out that some of this is trauma based from my last experience. Having a more dynamic language that isn't Java may make the experience better but in general everytime we had to update the GraphQL code it was cringy. Eventually started to gut the dynamic SQL and replacing it with a simple Query and then used GraphQL and trim the response which worked out much better. Generally the question to ask is how many iterations of an endpoint do you need and is it worth introducing a new technology vs just having a few query parameters to do some filtering. That being said, I'm now looking at some Query language to work with Neo4J so I'm back at looking at dynamic APIs. (: |
While this is cool, in theory, I haven't found it to be in practice. If it's an internal API, you can just provide a way for the client to get exactly what they need in a single query. If it's an external API, you have to deal with putting limits in place to keep users from burdening the system with complicated requests. Limits can become complex very quickly.