An example of GraphQL server supporting Relay modern written with Play framework, Sangria and Slick.
- Create a database named foodie and run
sbt "runMain models.mains.SlickDatabaseGenerator"
to generate the required tables in it. - Run
sbt "runMain models.mains.GenerateSchemaGraphql"
to generate the GraphQL schema in the file, ui/src/data/schema.graphql. This file is required by Relay Compiler. - Run
cd ui
and runnpm install
to install the npm packages. - Run
npm run relay
to generate the files required by Relay Babel plugin. - Run
npm run build
to bundle JavaScript UI source code. - Run
npm run css
to compile Sass. - Run
cd ..
and run the web server usingsbt run
and go to http://localhost:9000 for the app and go to http://localhost:9000/graphiql for GraphiQL.
Note: The default database configuration is based on MySQL. You can change the database configuration in the file, conf/application.conf.