A starter kit to help you start building VR application with React Native and GraphQL.
The kit comes loaded with a public GraphQL api hosted on scaphold.io that instantly connects your VR app to a real-time stream of messages.
Getting started is simple.
-
If you don't already have node install it. We also need watchman.
brew install node brew install watchman
-
The starter kit requires react native. Let's install it.
npm install -g react-native-cli
-
Get the code and install the dependencies
git clone https://github.com/scaphold-io/react-vr-graphql.git react-vr-graphql cd react-vr-graphql npm install
npm start
Open http://localhost:8081/vr/ to see your VR application.
Open https://us-west-2.api.scaphold.io/graphql/react-vr-graphql to open GraphiQL.
To create a message in our api we can enter this simple query:
mutation CreateMessage($message:CreateMessageInput!) {
createMessage(input:$message) {
changedMessage {
id
content
}
}
}
with these variables:
{
"message": {
"content": "GraphQL Rocks!"
}
}
Click Cmd-Enter
or click the run button.
Open GraphiQL and your VR app side-by-side in two browser windows and watch as your VR app automatically updates to your messages as you create them.
The root of the application can be found in index.vr.js
. The vr
directory contains some
initial setup requirements by the vr environment and shouldn't need to change much.
It's time to play around and start building! We hope this helps you build awesome VR apps!
With love from scaphold.io