next method

Context next({
  1. required TypeDefinitionNode nextType,
  2. Name? nextFieldName,
  3. Name? nextClassName,
  4. Name? alias,
  5. Nullable<TypeDefinitionNode?>? ofUnion,
  6. List<Definition>? generatedClasses,
  7. List<QueryInput>? inputsClasses,
  8. 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,
  );
}