Skip to content

Instantly share code, notes, and snippets.

type User {
id: ID!
name: String!
age: Int!
todos: [Todo!]!
createdAt: String!
updatedAt: String!
}
extend type Query {
package graph
// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
import (
"context"
"golang-clean-architecture-ent-gqlgen/ent"
"golang-clean-architecture-ent-gqlgen/ent/todo"
"golang-clean-architecture-ent-gqlgen/graph/generated"
models:
ID:
model:
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32
Int:
model:
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
enum TodoStatus {
IN_PROGRESS
COMPLETED
}
type Todo {
id: ID!
name: String!
status: TodoStatus!
priority: Int!
package graph
// This file will be automatically regenerated based on the schema, any resolver implementations
// will be copied through when generating and any unknown code will be moved to the end.
import (
"context"
"golang-clean-architecture-ent-gqlgen/ent"
"golang-clean-architecture-ent-gqlgen/ent/user"
"golang-clean-architecture-ent-gqlgen/graph/generated"
# Where should any generated models go?
#model:
# filename: graph/model/models_gen.go
# package: model
autobind:
- "golang-clean-architecture-ent-gqlgen/ent"
type User {
id: ID!
name: String!
age: Int!
createdAt: String!
updatedAt: String!
}
extend type Query {
user(id: ID): User
type Query
package main
import (
"golang-clean-architecture-ent-gqlgen/config"
"golang-clean-architecture-ent-gqlgen/ent"
"golang-clean-architecture-ent-gqlgen/graph"
"log"
"net/http"
"entgo.io/ent/dialect"