copyWith method

GenerationContext copyWith({
  1. SchemaMap? schemaMap,
  2. List<TypeName>? path,
  3. TypeDefinitionNode? currentType,
  4. ClassPropertyName? currentFieldName,
  5. ClassName? currentClassName,
  6. List<Definition>? generatedClasses,
  7. List<QueryInput>? inputsClasses,
  8. List<FragmentDefinitionNode>? fragments,
  9. Set<EnumName>? usedEnums,
  10. Set<ClassName>? usedInputObjects,
})

Creates a new GenerationContext with updated values

Implementation

GenerationContext copyWith({
  SchemaMap? schemaMap,
  List<TypeName>? path,
  TypeDefinitionNode? currentType,
  ClassPropertyName? currentFieldName,
  ClassName? currentClassName,
  List<Definition>? generatedClasses,
  List<QueryInput>? inputsClasses,
  List<FragmentDefinitionNode>? fragments,
  Set<EnumName>? usedEnums,
  Set<ClassName>? usedInputObjects,
}) {
  return GenerationContext(
    schemaMap: schemaMap ?? this.schemaMap,
    path: path ?? this.path,
    currentType: currentType ?? this.currentType,
    currentFieldName: currentFieldName ?? this.currentFieldName,
    currentClassName: currentClassName ?? this.currentClassName,
    generatedClasses: generatedClasses ?? this.generatedClasses,
    inputsClasses: inputsClasses ?? this.inputsClasses,
    fragments: fragments ?? this.fragments,
    usedEnums: usedEnums ?? this.usedEnums,
    usedInputObjects: usedInputObjects ?? this.usedInputObjects,
  );
}