- EntGo (https://entgo.io)
- GQLGen (https://gqlgen.com)
- React
- Relay (https://relay.dev)
Check out.
- Run docker compose up
docker compose up
- Run API
cd api
go mod tidy
go run cmd/main.go
- Run Frontend
cd www
yarn install
yarn dev
http://localhost:8080/graphql https://app-template.8doc.xyz/graphql
- Schema definition /api/schema/entity
- GraphQL definition /api/schema/graphql
- GraphQL resolvers /api/pkg/resolvers
- Change schema in /api/schema/entity
- Run
go generate
- Change/add schema definition in /api/schema/graphql
Ex. In invoice.graphql, add:
createInvoice(input: CreateInvoiceInput!): Invoice
-
Run
go generate
-
Add implementation to resolvers
in invoice.resolvers.go
func (r *mutationResolver) CreateInvoice(ctx context.Context, input ent.CreateInvoiceInput) (*ent.Invoice, error) {
return r.Client.Invoice.Create().
SetInput(input).
Save(ctx)
}
- Install Relay plugin in VS Code.
- Run relay-compiler
yarn relay watch
See Home.tsx
See InvoiceEditor.tsx