Skip to content

Commit

Permalink
Merge branch 'master' into nithin/add-tracing-to-response
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisnithin authored Nov 14, 2023
2 parents 87270c7 + aaa3d9a commit c5d2f96
Show file tree
Hide file tree
Showing 8 changed files with 693 additions and 337 deletions.
4 changes: 4 additions & 0 deletions v2/pkg/astjson/astjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ func (j *JSON) ObjectFieldKey(objectFieldRef int) []byte {
return j.storage[j.Nodes[objectFieldRef].keyStart:j.Nodes[objectFieldRef].keyEnd]
}

func (j *JSON) ObjectFieldValue(objectFieldRef int) int {
return j.Nodes[objectFieldRef].ObjectFieldValue
}

type Node struct {
Kind NodeKind
ObjectFieldValue int
Expand Down
4 changes: 3 additions & 1 deletion v2/pkg/astprinter/astprinter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,9 @@ func (p *printVisitor) LeaveSchemaExtension(ref int) {
if p.indent != nil {
p.write(literal.LINETERMINATOR)
}
p.write(literal.RBRACE)
if len(p.document.SchemaExtensions[ref].SchemaDefinition.RootOperationTypeDefinitions.Refs) > 0 {
p.write(literal.RBRACE)
}
if !p.document.NodeIsLastRootNode(ast.Node{Kind: ast.NodeKindSchemaExtension, Ref: ref}) {
if p.indent != nil {
p.write(literal.LINETERMINATOR)
Expand Down
5 changes: 5 additions & 0 deletions v2/pkg/astprinter/astprinter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ vary: [String]! = []) on QUERY directive @include(if: Boolean!) repeatable on FI
subscription: Subscription
}`, `extend schema @foo {query: Query mutation: Mutation subscription: Subscription}`)
})

t.Run("schema extension only directives", func(t *testing.T) {
run(t, `extend schema @foo `, `extend schema @foo `)
})

t.Run("object type definition", func(t *testing.T) {
run(t, `
type Foo {
Expand Down
2 changes: 1 addition & 1 deletion v2/pkg/engine/plan/configuration_visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func (c *configurationVisitor) handleMissingPath(typeName string, fieldName stri
}
}

c.walker.StopWithInternalErr(errors.Wrap(fmt.Errorf("could not plan a field %s.%s on a path %s", typeName, fieldName, currentPath), "configurationVisitor.handleMissingPath"))
c.walker.StopWithInternalErr(errors.Wrap(fmt.Errorf("could not plan field %s.%s on path %s", typeName, fieldName, currentPath), "configurationVisitor.handleMissingPath"))
}

func (c *configurationVisitor) LeaveField(ref int) {
Expand Down
140 changes: 0 additions & 140 deletions v2/pkg/engine/plan/planner_closer_test.go

This file was deleted.

Loading

0 comments on commit c5d2f96

Please sign in to comment.