Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.1 KB

File metadata and controls

31 lines (24 loc) · 1.1 KB
id babel-plugin
title Relay Babel Plugin
slug /getting-started/babel-plugin/
description Setting up Relay's Babel plugin
keywords
babel

Babel Plugin

Relay requires a Babel plugin to convert GraphQL to compiler-generated runtime artifacts. Depending upon what framework/bundler you are using, there may be a framework-specific plugin you can use:

If not, you can install the Babel plugin manually:

yarn add --dev babel-plugin-relay graphql

Add "relay" to the list of plugins in your .babelrc file:

{
  "plugins": ["relay"]
}

Please note that the "relay" plugin should run before other plugins or presets to ensure the graphql template literals are correctly transformed. See Babel's documentation on this topic.