visitFieldNode method
appends type name to OperationDefinitionNode
Implementation
@override
FieldNode visitFieldNode(FieldNode node) {
if (node.selectionSet == null) {
return node;
}
return FieldNode(
name: node.name,
alias: node.alias,
arguments: node.arguments,
directives: node.directives,
span: node.span,
selectionSet: SelectionSetNode(
selections: <SelectionNode>[
...node.selectionSet?.selections.where((element) =>
(element is! FieldNode) ||
(element.name.value != typeName)) ??
[],
FieldNode(name: NameNode(value: typeName)),
],
),
);
}