visitInlineFragmentNode method
Visit InlineFragmentNode
.
Implementation
@override
void visitInlineFragmentNode(InlineFragmentNode node) {
logFn(context, context.align + 1,
'${context.path}: ... on ${node.typeCondition!.on.name.value}');
final nextType = gql.getTypeByName(
context.typeDefinitionNodeVisitor, node.typeCondition!.on);
if (nextType.name.value == context.currentType!.name.value) {
final visitor = GeneratorVisitor(
context: context.nextTypeWithSamePath(
nextType: nextType,
nextClassName: null,
nextFieldName: null,
ofUnion: Nullable<TypeDefinitionNode?>(context.currentType),
inputsClasses: [],
fragments: [],
),
);
node.selectionSet.visitChildren(visitor);
} else {
final visitor = GeneratorVisitor(
context: context.next(
nextType: nextType,
nextClassName: ClassName(name: nextType.name.value),
nextFieldName: ClassPropertyName(name: nextType.name.value),
ofUnion: Nullable<TypeDefinitionNode?>(context.currentType),
inputsClasses: [],
fragments: [],
),
);
node.visitChildren(visitor);
}
}