This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cd docker || exit | |
| docker compose cp ./mysql_data/sql mysql:/var/lib/mysql/ | |
| docker compose exec mysql bash -c "mysql -uroot -proot < /var/lib/mysql/sql/reset_database.e2e.sql" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ReadConfigE2E reads config file for e2e. | |
| func ReadConfigE2E() { | |
| config.ReadConfig(config.ReadConfigOption{ | |
| AppEnv: environment.E2E, | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package e2e | |
| import ( | |
| "golang-clean-architecture-ent-gqlgen/ent" | |
| "golang-clean-architecture-ent-gqlgen/pkg/adapter/controller" | |
| "golang-clean-architecture-ent-gqlgen/pkg/infrastructure/graphql" | |
| "golang-clean-architecture-ent-gqlgen/pkg/infrastructure/router" | |
| "golang-clean-architecture-ent-gqlgen/pkg/registry" | |
| "golang-clean-architecture-ent-gqlgen/testutil" | |
| "net/http/httptest" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package mutation_test | |
| import ( | |
| "context" | |
| "golang-clean-architecture-ent-gqlgen/ent" | |
| "golang-clean-architecture-ent-gqlgen/pkg/infrastructure/router" | |
| "golang-clean-architecture-ent-gqlgen/testutil" | |
| "golang-clean-architecture-ent-gqlgen/testutil/e2e" | |
| "net/http" | |
| "testing" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package graph | |
| import ( | |
| "context" | |
| "golang-ent-gqlgen-example/ent" | |
| "golang-ent-gqlgen-example/ent/user" | |
| "golang-ent-gqlgen-example/graph/generated" | |
| "time" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Configure the GraphQL server and start | |
| srv := handler.NewDefaultServer(graph.NewSchema(client)) | |
| { | |
| e.POST("/query", func(c echo.Context) error { | |
| srv.ServeHTTP(c.Response(), c.Request()) | |
| return nil | |
| }) | |
| e.GET("/playground", func(c echo.Context) error { | |
| playground.Handler("GraphQL", "/query").ServeHTTP(c.Response(), c.Request()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package graph | |
| import ( | |
| "golang-ent-gqlgen-example/ent" | |
| "golang-ent-gqlgen-example/graph/generated" | |
| "github.com/99designs/gqlgen/graphql" | |
| ) | |
| type Resolver struct{ client *ent.Client } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // +build ignore | |
| package main | |
| import ( | |
| "errors" | |
| "log" | |
| "entgo.io/contrib/entgql" | |
| "entgo.io/ent/entc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type User { | |
| id: ID! | |
| name: String! | |
| age: Int! | |
| createdAt: String! | |
| } | |
| type Query { | |
| user: User | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Where are all the schema files located? globs are supported eg src/**/*.graphqls | |
| schema: | |
| - graph/*.graphqls | |
| # Where should the generated server code go? | |
| exec: | |
| filename: graph/generated/generated.go | |
| package: generated | |
| # Uncomment to enable federation |