Skip to content

Commit

Permalink
Add a test case for this
Browse files Browse the repository at this point in the history
  • Loading branch information
comigor committed Jan 3, 2020
1 parent cf621c4 commit 2767f42
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/analyzer.yml
Expand Up @@ -2,7 +2,6 @@ name: Package analyzer
on: [push, pull_request]

jobs:

package-analysis:
runs-on: ubuntu-latest
steps:
Expand Down
25 changes: 23 additions & 2 deletions test/query_generator/query_generator_test.dart
Expand Up @@ -977,6 +977,13 @@ class SomeQuery with EquatableMixin {
queryType: GraphQLType(name: 'Query', kind: GraphQLTypeKind.OBJECT),
types: [
GraphQLType(name: 'String', kind: GraphQLTypeKind.SCALAR),
GraphQLType(
name: 'MyEnum',
kind: GraphQLTypeKind.ENUM,
enumValues: [
GraphQLEnumValue(name: 'value1'),
GraphQLEnumValue(name: 'value2'),
]),
GraphQLType(name: 'Query', kind: GraphQLTypeKind.OBJECT, fields: [
GraphQLField(
name: 's',
Expand All @@ -986,6 +993,10 @@ class SomeQuery with EquatableMixin {
name: 'o',
type: GraphQLType(
name: 'SomeObject', kind: GraphQLTypeKind.OBJECT)),
GraphQLField(
name: 'e',
type:
GraphQLType(name: 'MyEnum', kind: GraphQLTypeKind.ENUM)),
]),
GraphQLType(
name: 'SomeObject',
Expand Down Expand Up @@ -1039,6 +1050,7 @@ class SomeQuery with EquatableMixin {
str
}
}
e
}
''';

Expand All @@ -1056,7 +1068,8 @@ class SomeQuery with EquatableMixin {
'SomeQuery',
[
ClassProperty('String', 's'),
ClassProperty('SomeQuerySomeObject', 'o')
ClassProperty('SomeQuerySomeObject', 'o'),
ClassProperty('SomeQueryMyEnum', 'e')
],
prefix: 'SomeQuery'),
ClassDefinition(
Expand All @@ -1081,6 +1094,7 @@ class SomeQuery with EquatableMixin {
annotation: 'JsonKey(name: \'__resolveType\')')
],
prefix: 'SomeQuery'),
EnumDefinition('SomeQueryMyEnum', ['value1', 'value2']),
],
),
],
Expand Down Expand Up @@ -1110,8 +1124,10 @@ class SomeQuery with EquatableMixin {
SomeQuerySomeObject o;
SomeQueryMyEnum e;
@override
List<Object> get props => [s, o];
List<Object> get props => [s, o, e];
Map<String, dynamic> toJson() => _\$SomeQueryToJson(this);
}
Expand Down Expand Up @@ -1166,6 +1182,11 @@ class SomeQueryAInterface with EquatableMixin {
List<Object> get props => [st, resolveType];
Map<String, dynamic> toJson() => _\$SomeQueryAInterfaceToJson(this);
}
enum SomeQueryMyEnum {
value1,
value2,
}
''',
});
});
Expand Down

0 comments on commit 2767f42

Please sign in to comment.