Nothing about what you just posted couldn't be done with a normal RESTful endpoint with sufficient support for column-level filtering and embedded item filtering.
Your post is the perfect example of GraphQL is being over hyped. I absolutely get that there's a benefit to filtering at both these levels, and that the DSL cuts down on noise and gives you a way to "query" without thinking of web requests, but it's not a leap in thinking -- teams that have to deal with mobile environments have long been strapping on filtering options to endpoints to avoid sending unneeded bytes to mobile devices.
Yes -- GraphQL standardizes this stuff, but it does it in a way that is basically not compatible with anything else.
> The component knows what it needs to render, so it declares that.
??? The component doesn't know anything, components don't think. You're describing it as if you just gave the component a list of entities but you actually wrote a query DSL -- that's how the component "knows" -- you told it.
What GraphQL is doing for you here is:
- Enforcing consistent access patterns (which is how "posts" gets translated into the right URL)
- Ensuring "limit" is supported on the endpoint
- Ensuring horizontal filtering is supported
- Ensuring embedded entities get returned and they're filtered
This is not a paradigm shift. It's better, maybe, but that DSL will absolutely fail you at some point, when you try do a more dynamic query, and you'll have to drop back to writing code that looks a lot like life did before GraphQL.
> With TypeScript, you can get type-safety all the way from the backend to the frontend, which means your IDE (e.g. VS Code) can correctly autocomplete, say, "creator." and suggest "name". It's rather magical.
This is basically orthogonal... Write well typed javascript and your IDE is going to be able to help you out.
> Firebase-like data store with schemas and joins
You've lost me here. The excerpt you've posted looks even worse than SQL. At that point why not just send SQL directly to the backend (as long as you can get the permissions right and your DB is secure enough)?