Skip to content
This repository was archived by the owner on Apr 1, 2024. It is now read-only.

Commit 1a9fe4f

Browse files
committed
added specifiedBy resolver
1 parent c2c3e8f commit 1a9fe4f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

internal/gqlgen/gqlgen.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ func (e *ExecutableSchema) Exec(oc *graphql.OperationContext, opts ...ExecOption
106106
return &buf
107107
}
108108

109+
var (
110+
queryImplementors = []string{"Query"}
111+
112+
__DirectiveImplementors = []string{"__Directive"}
113+
__EnumValueImplementors = []string{"__EnumValue"}
114+
__FieldImplementors = []string{"__Field"}
115+
__InputValueImplementors = []string{"__InputValue"}
116+
__SchemaImplementors = []string{"__Schema"}
117+
__TypeImplementors = []string{"__Type"}
118+
)
119+
109120
type executionContext struct {
110121
*graphql.OperationContext
111122
*ExecutableSchema
@@ -382,6 +393,9 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o
382393
case "ofType":
383394
res := obj.OfType()
384395
out.Values[i] = ec.marshalType(ctx, field.Selections, res)
396+
case "specifiedBy":
397+
res := obj.SpecifiedBy()
398+
out.Values[i] = marshalNullableString(res)
385399
default:
386400
panic("unknown field " + strconv.Quote(field.Name))
387401
}

0 commit comments

Comments
 (0)