costGraphQLDirective top-level property
The directive definition to specify the query complexity cost associated with a Field or Type
Implementation
final costGraphQLDirective = GraphQLDirective(
name: 'cost',
locations: [
// Types
DirectiveLocation.SCALAR,
DirectiveLocation.OBJECT,
DirectiveLocation.INTERFACE,
DirectiveLocation.UNION,
DirectiveLocation.ENUM,
// Fields
DirectiveLocation.FIELD_DEFINITION,
],
description: 'The query complexity cost associated with a Field or Type',
isRepeatable: false,
inputs: [
graphQLInt.nonNull().inputField('complexity'),
],
);