Skip to content
/ graphql Public template

Example GraphQL Go server with Prisma

Notifications You must be signed in to change notification settings

robojones/graphql

Repository files navigation

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

About

Example GraphQL Go server with Prisma

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages