Follow the installation instructions from the Installation and Setup guide.
With some additional configuration, the
"relay" babel plugin can also translate
Relay.QL literals. Most importantly, include a reference to your GraphQL Schema as either a json file or graphql schema file.
When incrementally converting a Relay Classic app to Relay Modern,
literals can be translated to be usable by both runtimes if configured to use
The Relay Classic and Relay Compat modes produce generated content inline and may catch and log any detected GraphQL validation errors, leaving those errors to be thrown at runtime.
When compiling code for production deployment, the plugin can be configured to immediately throw upon encountering a validation problem. The plugin can be further customized for different environments with the following options: