React Native
Relay (GraphQL)
Download Schema
8min
download the graphql schema introduction in our previous guide we’ve learned more about the amazing graphql client relay now it’s time to understand how you can use relay to fetch data from back4app in order to use it on your react native app in this guide you will learn how to download the graphql schema file and place it on your react native project goal to prepare your react native project to use back4app graphql api by downloading the schema prerequisites this is not a tutorial yet, but to feel free confortable reading it you will need basic javascript knowledge basic understand about graphql if you don’t have, the graphql js its a perfect place to start a react native basic project running on your local environment 1 downloading the schema the schema is your source of truth from the server that will be located on your frontend on back4app the schema is an automatic file generated once you define your data model to better understand the back4app graphql schema you can open it on graphql console by doing the following steps go to your app back4app dashboard; on the left menu, click on api console, under the core tab; choose graphql and you will see something like this welcome to graphql playground here you can write and run queries, mutations using sdl language on the top right side you will see two tabs docs and schema on the docs tab you will find an easy to read documentation of the graphql api the documentation is based on the object types that are generated once you build your data model on back4app for devs this is awesome because it can be used as a quick reference to build your query and mutations back4app also also generates a specification to your graphql api the popular known schema the schema is found on the schema tab and is written using sdl(schema definition language) the schema will be used as a source of truth on your frontend go ahead, click over the sdl download and get the file to use on the next step 2 pasting the schema on react native app in order relay can read the schema file on the react native app you need to paste the schema file on a specific path let’s make this on your react native project create a folder on your application root path and name it data data paste the schema file (sdl) file on this folder done your frontend already has the source of truth from your backend with your graphql schema the final configuration is shown below important every time you change your data model on back4app your schema file will change it is very important to keep the schema file always updated on your front end so every time you change the schema you need to upload it again on your react native app project conclusion with the schema already placed on your react native application, now you will learn how to configure and prepare your environment to be able to fetch your components queries