From e26ee8b1e96534d9756507a519c3b720ae2d67ce Mon Sep 17 00:00:00 2001 From: Andrew Sisley Date: Tue, 16 Apr 2024 11:13:32 -0400 Subject: [PATCH] PR FIXUP - Use field definitions generating gql inputs Secondary fields do not exist in the schema, and thus schema.fields is incorrect here. --- request/graphql/schema/generate.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/request/graphql/schema/generate.go b/request/graphql/schema/generate.go index 4b0b2bdec2..6b7483be4f 100644 --- a/request/graphql/schema/generate.go +++ b/request/graphql/schema/generate.go @@ -540,7 +540,6 @@ func (g *Generator) buildMutationInputTypes(collections []client.CollectionDefin // will be reassigned before the thunk is run // TODO remove when Go 1.22 collection := c - fieldDescriptions := collection.Schema.Fields mutationInputName := collection.Description.Name.Value() + "MutationInputArg" // check if mutation input type exists @@ -558,7 +557,7 @@ func (g *Generator) buildMutationInputTypes(collections []client.CollectionDefin mutationObjConf.Fields = (gql.InputObjectConfigFieldMapThunk)(func() (gql.InputObjectConfigFieldMap, error) { fields := make(gql.InputObjectConfigFieldMap) - for _, field := range fieldDescriptions { + for _, field := range collection.GetFields() { if strings.HasPrefix(field.Name, "_") { // ignore system defined args as the // user cannot override their values