Compiling the schema before you begin
The code samples for this chapter already contain some additions:
- The
react-relay
,relay-compiler
, andbabel-plugin-relay
packages. - Babel configuration to ensure your build understands the new GraphQL syntax.
- Relay configuration in the
relay.config.json
file. The primary piece of configuration is the location of the schema. - A GraphQL schema in the file
src/schema.graphql
. - A server endpoint at
POST/graphql
, which services incoming GraphQL requests.
It’s beyond the scope of this book to go into each of these, but you will need to compile the schema before you begin, which can be done by typing the following command:
npx relay-compiler
The npm run build
command has also been modified to run this command for you, just in case you forget. Once everything is compiled, you’re ready to write some tests.