Skip to content

Commit

Permalink
PR FIXUP - Use field definitions generating gql inputs
Browse files Browse the repository at this point in the history
Secondary fields do not exist in the schema, and thus schema.fields is incorrect here.
  • Loading branch information
AndrewSisley committed Apr 16, 2024
1 parent 7534319 commit e26ee8b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions request/graphql/schema/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e26ee8b

Please sign in to comment.