visitOperationDefinitionNode method
Visit OperationDefinitionNode.
Implementation
@override
List<GraphQLError>? visitOperationDefinitionNode(
OperationDefinitionNode node,
) {
final name = node.name?.value;
if (name == null && operationCount > 1) {
return [
GraphQLError(
'This anonymous operation must be the only defined operation.',
locations: GraphQLErrorLocation.firstFromNodes([
node,
node.selectionSet,
node.selectionSet.selections.firstOrNull,
]),
extensions: _loneAnonymousOperationSpec.extensions(),
)
];
}
}