From 5585216e1b1e8ad262f5365a1cb6c5f500b0b709 Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" <12751435+giautm@users.noreply.github.com> Date: Thu, 14 Mar 2024 19:19:28 +0700 Subject: [PATCH] entgql: add missing directive's argument (#567) --- entgql/internal/todo/ent.graphql | 4 ++-- entgql/internal/todogotype/generated.go | 4 ++-- entgql/internal/todopulid/generated.go | 4 ++-- entgql/internal/todouuid/generated.go | 4 ++-- entgql/schema.go | 8 ++++++++ 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/entgql/internal/todo/ent.graphql b/entgql/internal/todo/ent.graphql index 614d68b6c..a3f3b1076 100644 --- a/entgql/internal/todo/ent.graphql +++ b/entgql/internal/todo/ent.graphql @@ -1,5 +1,5 @@ -directive @goField(forceResolver: Boolean, name: String) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION -directive @goModel(model: String, models: [String!]) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION +directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION type BillProduct implements Node { id: ID! name: String! diff --git a/entgql/internal/todogotype/generated.go b/entgql/internal/todogotype/generated.go index 763c31655..b3a519298 100644 --- a/entgql/internal/todogotype/generated.go +++ b/entgql/internal/todogotype/generated.go @@ -1399,8 +1399,8 @@ extend input CreateCategoryInput { interface NamedNode { name: String! }`, BuiltIn: false}, - {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION -directive @goModel(model: String, models: [String!]) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION + {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION type BillProduct implements Node { id: ID! name: String! diff --git a/entgql/internal/todopulid/generated.go b/entgql/internal/todopulid/generated.go index b68440738..4f5fb3357 100644 --- a/entgql/internal/todopulid/generated.go +++ b/entgql/internal/todopulid/generated.go @@ -1405,8 +1405,8 @@ extend input CreateCategoryInput { interface NamedNode { name: String! }`, BuiltIn: false}, - {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION -directive @goModel(model: String, models: [String!]) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION + {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION type BillProduct implements Node { id: ID! name: String! diff --git a/entgql/internal/todouuid/generated.go b/entgql/internal/todouuid/generated.go index 2667d2e75..e8cebaa97 100644 --- a/entgql/internal/todouuid/generated.go +++ b/entgql/internal/todouuid/generated.go @@ -1406,8 +1406,8 @@ extend input CreateCategoryInput { interface NamedNode { name: String! }`, BuiltIn: false}, - {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION -directive @goModel(model: String, models: [String!]) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION + {Name: "../todo/ent.graphql", Input: `directive @goField(forceResolver: Boolean, name: String, omittable: Boolean) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION +directive @goModel(model: String, models: [String!], forceGenerate: Boolean) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION type BillProduct implements Node { id: ID! name: String! diff --git a/entgql/schema.go b/entgql/schema.go index 39893888c..44f17aec9 100644 --- a/entgql/schema.go +++ b/entgql/schema.go @@ -60,6 +60,10 @@ var ( Name: "models", Type: ast.ListType(ast.NonNullNamedType("String", nil), nil), }, + { + Name: "forceGenerate", + Type: ast.NamedType("Boolean", nil), + }, }, Locations: []ast.DirectiveLocation{ ast.LocationObject, @@ -82,6 +86,10 @@ var ( Name: "name", Type: ast.NamedType("String", nil), }, + { + Name: "omittable", + Type: ast.NamedType("Boolean", nil), + }, }, Locations: []ast.DirectiveLocation{ ast.LocationFieldDefinition,