visitFragmentSpreadNode method

  1. @override
List<GraphQLError>? visitFragmentSpreadNode(
  1. FragmentSpreadNode node
)

Visit FragmentSpreadNode.

Implementation

@override
List<GraphQLError>? visitFragmentSpreadNode(FragmentSpreadNode node) {
  final found = fragments.containsKey(node.name.value);
  if (!found) {
    return [
      GraphQLError(
        'Unknown fragment "${node.name.value}".',
        locations: GraphQLErrorLocation.listFromSource(
          node.span?.start ?? node.name.span?.start,
        ),
        extensions: _knownFragmentNamesSpec.extensions(),
      )
    ];
  }
}