Notes on GraphQL
Posted on May 23, 2018 • 1 minutes • 105 words
Some personal notes while working with GraphQL
- Only enable GraphiQL in development.
- GraphQL is quite “chatty” by default. Use something like Facebook’s DataLoader for batching requests.
- DataLoader is not responsible for pagination . Implementation will be varied based on different backends.
- Apollo GraphQL is pretty awesome. Check out some of their open-source libraries.
- Using
cacheKeyFn
for batching function (DataLoader) with multiple parameters. Related issue: #75 - GraphQL is much more prone to attack because of its flexibility. You should implement auth/authorization as well as other protection mechanism like query depth limit , query cost analysis or just skip those and read this post
- Interfaces and Unions