Yes, you’re right. The basic tool most people use is Dataloader which lets you batch requests and cache data. I haven’t written a tutorial on that yet but maybe someone else has!? :) If you’re using SQL, another library to look into is JoinMonster, which I think generates more efficient SQL queries by walking the AST of the GraphQL query.
Hey, I decided to opt for simplicity in this tutorial. Caleb’s recommendations are solid if you want to follow them, but even if you start out with separate arguments you won’t code yourself into a corner. You can always create a new mutation with different arguments.
I think create-react-app is a great fit for this tutorial, because it saves us the work of setting up a webpack config and lets us focus on learning about GraphQL. All the concepts learned in this tutorial still apply when you want to set up your own webpack config for a production app.
Thanks! It’s definitely possible that something changed since I wrote the article. If anyone else runs into this, please let me know and I’ll check if the post needs to be updated.
I don’t think there is at the moment. In fact, it’s something we haven’t really figured out yet either. One common pattern is to include a
isOptimistic field for every type in the schema, but the problem with that is that it pushes a client concern to the server.
Yeah, that’s a great idea and you can definitely do some authorization inside the validation rules if it makes sense for your application. I did something along those lines in this package that forbids user from running the introspection query: https://github.com/helfer/graphql-disable-introspection The catch is that you can only check static rules…