Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 1.18 KB

README.md

File metadata and controls

55 lines (36 loc) · 1.18 KB

GraphQL Server Example

This example shows how to implement a GraphQL server with Golang based on Prisma & gqlgen.

How to use

1. Download repo

Clone the repository:

git clone [email protected]:robojones/graphql.git
cd graphql/

2. Install the Prisma CLI

To run the example, you need the Prisma CLI. Please install it via Homebrew or using another method:

brew install prisma
brew tap
# or
npm i -g prisma

3. Set up database & deploy Prisma datamodel

Start the server and the database using docker-compose:

docker-compose up -d

Deploy our schema to our database:

prisma deploy # this also runs prisma generate and gqlgen

4. Start the GraphQL server

go run ./server

Navigate to http://localhost:4000 in your browser to explore the API of your GraphQL server in a GraphQL Playground.

5. Changing the GraphQL schema

After you made changes to prisma or graphql schema files, just generate the files:

go generate