Skip to main content

Relay Operation Optimizer

Built and maintained by n1ru4l

A GraphQL Codegen feature for bringing the benefits of Relay Compiler to any GraphQL Client using Relay Operation Optimizer

You can test how relay-compiler affects your queries over on the Relay Compiler REPL.

List of Features#


Set up your project per the GraphQL Codegen Docs, and add flattenGeneratedTypes: true in your codegen.yml:

overwrite: true
schema: schema.graphql
documents: 'src/documents/**/*.graphql'
skipDocumentsValidation: true
flattenGeneratedTypes: true
- 'typescript'
- 'typescript-operations'
- 'typescript-react-apollo'

Please notice that you have to skip the document validation - but no worries, relay-compiler will validate your documents instead!

See Laurin Quast's blog post to learn how to use those directives in your operations