command
module
Version:
v0.0.0-...-3a1fd7c
Opens a new window with list of versions in this module.
Published: Dec 9, 2022
License: MIT
Opens a new window with license information.
Imports: 10
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
bff-gqlgen-sqlc-template
BFF(Backend For Frontend) with GraphQL generated its DB schema (postgres) by sqlc.
- 99designs/gqlgen
- vektah/dataloaden
- kjconroy/sqlc
Quickstart
- Create
.graphql
- Create a new project in hygraph / strapi
- Edit the schema on the browser
- Fill
ACCESS_TOKEN
, ENDPOINT
in .env.local
docker compose run export
creates schema.graphql
- Generate autostub codes in
/gen
- Write
schema.sql
- Write
queries.sql
- Edit generate code for each model in
dataloaders/generate.go
- Generate files in
/gen
by docker compose -f docker-compose.autogen up
- Fill the autostub codes.
- Write
resolver/resolvers.go
to pass queries to detaloaders
and mutations to repository
- Fill
repository/relations.go
only for entities with relations
- Fill
dataloaders/dataloaders.go
- To migrate tables, write down DDL in
schema.sql
on pgweb
Run GraphQL Server
docker compose up
Then access Playground.
If you want to see raw database or query it, you can access pgweb
If you want to try GraphQL API with Insomnia, you can import Insomnia.yaml
.
Special thanks
fwojciec/gqlgen-sqlc-example
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
|
|
gen
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.