Schema::type_field
should work for all variants of ExtendedType
#892
Labels
Schema::type_field
should work for all variants of ExtendedType
#892
Description
When processing operations in the demand control plugin, we traverse the
ExecutableDocument
and score each field based on its type and directives. Specifically, we check for directives applied to the schema. Since the router's request pipeline parses operations using the API schema instead of the supergraph schema, these directives onFieldDefinition
s are stripped.It has been suggested that we look up the supergraph schema's definitions using
Schema::type_field
, but this returns aNoSuchField
error for scalars, unions, enums, and input objects. Instead, these variants should have the same definition lookup functionality as objects and interfaces.Proposal
For variants of
ExtendedType
which do not already have it, add a field definition mapping equivalent to that on objects and interfaces:pub fields: IndexMap<Name, Component<FieldDefinition>>
. Then use the new lookups insideSchema::type_field
.The text was updated successfully, but these errors were encountered: