gql-demo is working demo for exploring the usage of libraries that enables a GraphQL server with database access that can mantain type safety and leverage code generation.
- Custom ORM:
sqlboiler
- GraphQL:
gqlgen
- GraphQL UI:
graphql-playground
Start the development server:
MYSQL_USER= MYSQL_PASSWORD= MYSQL_DB= bin/start.sh
Migrate the initial database schema:
MYSQL_USER= MYSQL_PASSWORD= MYSQL_DB= bin/migrate.sh
Generate Go code within internal/models
directory, uses the database schema:
bin/generate-models.sh
Generate Go code within cmd/graphql/gqlgen
directory, uses the graphql schema:
bin/generate-gql.sh