Skip to content

Commit

Permalink
PR: Adhere to code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzadlone committed Sep 2, 2022
1 parent f20d7fd commit 517742c
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 210 deletions.
4 changes: 1 addition & 3 deletions query/graphql/schema/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,7 @@ func (g *Generator) fromAST(ctx context.Context, document *ast.Document) ([]*gql
return defs, nil
}

func (g *Generator) expandInputArgument(
obj *gql.Object,
) error {
func (g *Generator) expandInputArgument(obj *gql.Object) error {
fields := obj.Fields()
for f, def := range fields {
// ignore reserved fields, execpt the Group field (as that requires typing), and aggregates
Expand Down
16 changes: 16 additions & 0 deletions tests/integration/schema/default_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,19 @@ var aggregateFields = fields{
},
},
}

// makeInputObjectForNameType retrned a properly made input field type
// using name (outer), name of type (inner), and types ofType.
func makeInputObjectForNameType(
name string,
typeName any,
ofType any,
) map[string]any {
return map[string]any{
"name": name,
"type": map[string]any{
"name": typeName,
"ofType": ofType,
},
}
}
Loading

0 comments on commit 517742c

Please sign in to comment.