You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We encountered the compilation error because conflicting between field name num and dart's type name num.
Our GQL definition files are already used at production, we can't change the definition.
How is adding alias for dart:core package?
We hope this problem solved soon.
Condition
There is the field named num
Also there is the field typed Float or Float! in same type
String toJson$Enum$__TypeKind(Enum$__TypeKind e) {
switch (e) {
case Enum$__TypeKind.SCALAR:
return r'SCALAR';
case Enum$__TypeKind.OBJECT:
return r'OBJECT';
case Enum$__TypeKind.INTERFACE:
return r'INTERFACE';
case Enum$__TypeKind.UNION:
return r'UNION';
case Enum$__TypeKind.ENUM:
return r'ENUM';
case Enum$__TypeKind.INPUT_OBJECT:
return r'INPUT_OBJECT';
case Enum$__TypeKind.LIST:
return r'LIST';
case Enum$__TypeKind.NON_NULL:
return r'NON_NULL';
case Enum$__TypeKind.$unknown:
return r'$unknown';
}
}
Enum$__TypeKind fromJson$Enum$__TypeKind(String value) {
switch (value) {
case r'SCALAR':
return Enum$__TypeKind.SCALAR;
case r'OBJECT':
return Enum$__TypeKind.OBJECT;
case r'INTERFACE':
return Enum$__TypeKind.INTERFACE;
case r'UNION':
return Enum$__TypeKind.UNION;
case r'ENUM':
return Enum$__TypeKind.ENUM;
case r'INPUT_OBJECT':
return Enum$__TypeKind.INPUT_OBJECT;
case r'LIST':
return Enum$__TypeKind.LIST;
case r'NON_NULL':
return Enum$__TypeKind.NON_NULL;
default:
return Enum$__TypeKind.$unknown;
}
}
String toJson$Enum$__DirectiveLocation(Enum$__DirectiveLocation e) {
switch (e) {
case Enum$__DirectiveLocation.QUERY:
return r'QUERY';
case Enum$__DirectiveLocation.MUTATION:
return r'MUTATION';
case Enum$__DirectiveLocation.SUBSCRIPTION:
return r'SUBSCRIPTION';
case Enum$__DirectiveLocation.FIELD:
return r'FIELD';
case Enum$__DirectiveLocation.FRAGMENT_DEFINITION:
return r'FRAGMENT_DEFINITION';
case Enum$__DirectiveLocation.FRAGMENT_SPREAD:
return r'FRAGMENT_SPREAD';
case Enum$__DirectiveLocation.INLINE_FRAGMENT:
return r'INLINE_FRAGMENT';
case Enum$__DirectiveLocation.VARIABLE_DEFINITION:
return r'VARIABLE_DEFINITION';
case Enum$__DirectiveLocation.SCHEMA:
return r'SCHEMA';
case Enum$__DirectiveLocation.SCALAR:
return r'SCALAR';
case Enum$__DirectiveLocation.OBJECT:
return r'OBJECT';
case Enum$__DirectiveLocation.FIELD_DEFINITION:
return r'FIELD_DEFINITION';
case Enum$__DirectiveLocation.ARGUMENT_DEFINITION:
return r'ARGUMENT_DEFINITION';
case Enum$__DirectiveLocation.INTERFACE:
return r'INTERFACE';
case Enum$__DirectiveLocation.UNION:
return r'UNION';
case Enum$__DirectiveLocation.ENUM:
return r'ENUM';
case Enum$__DirectiveLocation.ENUM_VALUE:
return r'ENUM_VALUE';
case Enum$__DirectiveLocation.INPUT_OBJECT:
return r'INPUT_OBJECT';
case Enum$__DirectiveLocation.INPUT_FIELD_DEFINITION:
return r'INPUT_FIELD_DEFINITION';
case Enum$__DirectiveLocation.$unknown:
return r'$unknown';
}
}
Enum$__DirectiveLocation fromJson$Enum$__DirectiveLocation(String value) {
switch (value) {
case r'QUERY':
return Enum$__DirectiveLocation.QUERY;
case r'MUTATION':
return Enum$__DirectiveLocation.MUTATION;
case r'SUBSCRIPTION':
return Enum$__DirectiveLocation.SUBSCRIPTION;
case r'FIELD':
return Enum$__DirectiveLocation.FIELD;
case r'FRAGMENT_DEFINITION':
return Enum$__DirectiveLocation.FRAGMENT_DEFINITION;
case r'FRAGMENT_SPREAD':
return Enum$__DirectiveLocation.FRAGMENT_SPREAD;
case r'INLINE_FRAGMENT':
return Enum$__DirectiveLocation.INLINE_FRAGMENT;
case r'VARIABLE_DEFINITION':
return Enum$__DirectiveLocation.VARIABLE_DEFINITION;
case r'SCHEMA':
return Enum$__DirectiveLocation.SCHEMA;
case r'SCALAR':
return Enum$__DirectiveLocation.SCALAR;
case r'OBJECT':
return Enum$__DirectiveLocation.OBJECT;
case r'FIELD_DEFINITION':
return Enum$__DirectiveLocation.FIELD_DEFINITION;
case r'ARGUMENT_DEFINITION':
return Enum$__DirectiveLocation.ARGUMENT_DEFINITION;
case r'INTERFACE':
return Enum$__DirectiveLocation.INTERFACE;
case r'UNION':
return Enum$__DirectiveLocation.UNION;
case r'ENUM':
return Enum$__DirectiveLocation.ENUM;
case r'ENUM_VALUE':
return Enum$__DirectiveLocation.ENUM_VALUE;
case r'INPUT_OBJECT':
return Enum$__DirectiveLocation.INPUT_OBJECT;
case r'INPUT_FIELD_DEFINITION':
return Enum$__DirectiveLocation.INPUT_FIELD_DEFINITION;
default:
return Enum$__DirectiveLocation.$unknown;
}
}
class Query$Query {
Query$Query({
this.definition,
this.$__typename = 'Query',
});
factory Query$Query.fromJson(Map<String, dynamic> json) {
final l$definition = json['definition'];
final l$$__typename = json['__typename'];
return Query$Query(
definition: l$definition == null
? null
: Query$Query$definition.fromJson(
(l$definition as Map<String, dynamic>)),
$__typename: (l$$__typename as String),
);
}
final Query$Query$definition? definition;
final String $__typename;
Map<String, dynamic> toJson() {
final _resultData = <String, dynamic>{};
final l$definition = definition;
_resultData['definition'] = l$definition?.toJson();
final l$$__typename = $__typename;
_resultData['__typename'] = l$$__typename;
return _resultData;
}
@override
int get hashCode {
final l$definition = definition;
final l$$__typename = $__typename;
return Object.hashAll([
l$definition,
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (!(other is Query$Query) || runtimeType != other.runtimeType) {
return false;
}
final l$definition = definition;
final lOther$definition = other.definition;
if (l$definition != lOther$definition) {
return false;
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Query$Query on Query$Query {
CopyWith$Query$Query<Query$Query> get copyWith => CopyWith$Query$Query(
this,
(i) => i,
);
}
abstract class CopyWith$Query$Query {
factory CopyWith$Query$Query(
Query$Query instance,
TRes Function(Query$Query) then,
) = _CopyWithImpl$Query$Query;
class Query$Query$definition {
Query$Query$definition({
this.num,
this.problem,
this.$__typename = 'Definition',
});
factory Query$Query$definition.fromJson(Map<String, dynamic> json) {
final l$num = json['num'];
final l$problem = json['problem'];
final l$$__typename = json['__typename'];
return Query$Query$definition(
num: (l$num as int?),
problem: (l$problem as num?)?.toDouble(),
$__typename: (l$$__typename as String),
);
}
final int? num;
final double? problem;
final String $__typename;
Map<String, dynamic> toJson() {
final _resultData = <String, dynamic>{};
final l$num = num;
_resultData['num'] = l$num;
final l$problem = problem;
_resultData['problem'] = l$problem;
final l$$__typename = $__typename;
_resultData['__typename'] = l$$__typename;
return _resultData;
}
@override
int get hashCode {
final l$num = num;
final l$problem = problem;
final l$$__typename = $__typename;
return Object.hashAll([
l$num,
l$problem,
l$$__typename,
]);
}
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (!(other is Query$Query$definition) ||
runtimeType != other.runtimeType) {
return false;
}
final l$num = num;
final lOther$num = other.num;
if (l$num != lOther$num) {
return false;
}
final l$problem = problem;
final lOther$problem = other.problem;
if (l$problem != lOther$problem) {
return false;
}
final l$$__typename = $__typename;
final lOther$$__typename = other.$__typename;
if (l$$__typename != lOther$$__typename) {
return false;
}
return true;
}
}
extension UtilityExtension$Query$Query$definition on Query$Query$definition {
CopyWith$Query$Query$definition<Query$Query$definition> get copyWith =>
CopyWith$Query$Query$definition(
this,
(i) => i,
);
}
abstract class CopyWith$Query$Query$definition {
factory CopyWith$Query$Query$definition(
Query$Query$definition instance,
TRes Function(Query$Query$definition) then,
) = _CopyWithImpl$Query$Query$definition;
👋 @kikuchy
Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible.
Please make sure you have provided enough context.
This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.
Thank you for improving awesome this package!
We encountered the compilation error because conflicting between field name
num
and dart's type namenum
.Our GQL definition files are already used at production, we can't change the definition.
How is adding alias for
dart:core
package?We hope this problem solved soon.
Condition
num
Float
orFloat!
in same typeMinimum example
Part of generated code
Whole generated code
The text was updated successfully, but these errors were encountered: