next method
Context
next({
- required TypeDefinitionNode nextType,
- Name? nextFieldName,
- Name? nextClassName,
- Name? alias,
- Nullable<
TypeDefinitionNode?> ? ofUnion, - List<
Definition> ? generatedClasses, - List<
QueryInput> ? inputsClasses, - List<
FragmentDefinitionNode> ? fragments,
Returns a copy of this context, with a new type on a new path.
Implementation
Context next({
required TypeDefinitionNode nextType,
Name? nextFieldName,
Name? nextClassName,
Name? alias,
Nullable<TypeDefinitionNode?>? ofUnion,
List<Definition>? generatedClasses,
List<QueryInput>? inputsClasses,
List<FragmentDefinitionNode>? fragments,
}) {
assert(alias != null || (nextFieldName != null && nextClassName != null));
return Context(
schema: schema,
typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,
options: options,
schemaMap: schemaMap,
path: path
.followedBy([
_stringForNaming(
alias ?? nextFieldName,
alias ?? nextClassName,
)
].whereType<Name>())
.toList(),
currentType: nextType,
currentFieldName: nextFieldName,
currentClassName: nextClassName,
ofUnion: ofUnion == null ? this.ofUnion : ofUnion.value,
generatedClasses: generatedClasses ?? this.generatedClasses,
inputsClasses: inputsClasses ?? this.inputsClasses,
fragments: fragments ?? this.fragments,
align: align + 1,
usedEnums: usedEnums,
usedInputObjects: usedInputObjects,
);
}