This repository contains the Keskin GraphQL API.
This API connects to Prisma Server and Prisma Server is connected to Postgres Database
Api > Prisma > Postgres
npm install -g prisma1
go get golang.org/dl/go1.13
go1.13 download
go1.13 get
go1.13 generate
OR
You can install Go Version Manager
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
gvm install go1.13
gvm use go1.13 --default
Start the prisma server and the database using docker-compose:
docker-compose up -d
After you made changes to prisma or graphql schema files, just generate the files:
go generate # This actually runs below commands along with gqlgen you can look at main.go for other commands
prisma1 generate # This will generate Prisma Client
prisma1 deploy # This will migrate database to postgres using Prisma Server
If for prisam1 deploy
fails then you can change the endpoint with env PRISMA_HOST
and APP_NAMESPACE
to the hard coded ones in the prisma > prisma.yml
file.
For Seeding you can run
prisma1 seed # This will run the main function in `seed > seed.go as configured in prisma.yml`
go run ./server
Navigate to http://localhost:4000 in your browser to explore the API of your GraphQL server in a GraphQL Playground.