Skip to content

Commit 9dd401e

Browse files
authored
feat: Upgrade builder (heftapp#326)
1 parent c64c287 commit 9dd401e

62 files changed

Lines changed: 2083 additions & 18 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/graphql_codegen/example/lib/fragments.graphql.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ class _CopyWithImpl$Fragment$PersonSummary<TRes>
294294
? _instance.$__typename
295295
: ($__typename as String),
296296
));
297+
297298
TRes parents(
298299
Iterable<Fragment$PersonParent>? Function(
299300
Iterable<
@@ -305,6 +306,7 @@ class _CopyWithImpl$Fragment$PersonSummary<TRes>
305306
e,
306307
(i) => i,
307308
)))?.toList());
309+
308310
CopyWith$Fragment$PersonParent<TRes> get favParent {
309311
final local$favParent = _instance.favParent;
310312
return local$favParent == null
@@ -331,7 +333,9 @@ class _CopyWithStubImpl$Fragment$PersonSummary<TRes>
331333
String? $__typename,
332334
}) =>
333335
_res;
336+
334337
parents(_fn) => _res;
338+
335339
CopyWith$Fragment$PersonParent<TRes> get favParent =>
336340
CopyWith$Fragment$PersonParent.stub(_res);
337341
}

packages/graphql_codegen/example/lib/main.graphql.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Variables$Query$FetchPerson {
2424
Map<String, dynamic> _$data;
2525

2626
String get id => (_$data['id'] as String);
27+
2728
Map<String, dynamic> toJson() {
2829
final result$data = <String, dynamic>{};
2930
final l$id = id;
@@ -36,6 +37,7 @@ class Variables$Query$FetchPerson {
3637
this,
3738
(i) => i,
3839
);
40+
3941
@override
4042
bool operator ==(Object other) {
4143
if (identical(this, other)) {
@@ -212,6 +214,7 @@ class _CopyWithImpl$Query$FetchPerson<TRes>
212214
? _instance.$__typename
213215
: ($__typename as String),
214216
));
217+
215218
CopyWith$Query$FetchPerson$fetchPerson<TRes> get fetchPerson {
216219
final local$fetchPerson = _instance.fetchPerson;
217220
return local$fetchPerson == null
@@ -232,6 +235,7 @@ class _CopyWithStubImpl$Query$FetchPerson<TRes>
232235
String? $__typename,
233236
}) =>
234237
_res;
238+
235239
CopyWith$Query$FetchPerson$fetchPerson<TRes> get fetchPerson =>
236240
CopyWith$Query$FetchPerson$fetchPerson.stub(_res);
237241
}
@@ -811,6 +815,7 @@ class _CopyWithImpl$Query$FetchPerson$fetchPerson<TRes>
811815
? _instance.children
812816
: (children as List<Fragment$PersonSummary>?),
813817
));
818+
814819
TRes parents(
815820
Iterable<Query$FetchPerson$fetchPerson$parents>? Function(
816821
Iterable<
@@ -823,6 +828,7 @@ class _CopyWithImpl$Query$FetchPerson$fetchPerson<TRes>
823828
e,
824829
(i) => i,
825830
)))?.toList());
831+
826832
CopyWith$Fragment$PersonParent<TRes> get favParent {
827833
final local$favParent = _instance.favParent;
828834
return local$favParent == null
@@ -862,9 +868,12 @@ class _CopyWithStubImpl$Query$FetchPerson$fetchPerson<TRes>
862868
List<Fragment$PersonSummary>? children,
863869
}) =>
864870
_res;
871+
865872
parents(_fn) => _res;
873+
866874
CopyWith$Fragment$PersonParent<TRes> get favParent =>
867875
CopyWith$Fragment$PersonParent.stub(_res);
876+
868877
children(_fn) => _res;
869878
}
870879

@@ -1164,6 +1173,7 @@ class _CopyWithImpl$Query$FetchPerson$fetchPerson$parents<TRes>
11641173
? _instance.favParent
11651174
: (favParent as Fragment$PersonParent?),
11661175
));
1176+
11671177
TRes parents(
11681178
Iterable<Fragment$PersonParent>? Function(
11691179
Iterable<
@@ -1175,6 +1185,7 @@ class _CopyWithImpl$Query$FetchPerson$fetchPerson$parents<TRes>
11751185
e,
11761186
(i) => i,
11771187
)))?.toList());
1188+
11781189
CopyWith$Fragment$PersonParent<TRes> get favParent {
11791190
final local$favParent = _instance.favParent;
11801191
return local$favParent == null
@@ -1201,7 +1212,9 @@ class _CopyWithStubImpl$Query$FetchPerson$fetchPerson$parents<TRes>
12011212
Fragment$PersonParent? favParent,
12021213
}) =>
12031214
_res;
1215+
12041216
parents(_fn) => _res;
1217+
12051218
CopyWith$Fragment$PersonParent<TRes> get favParent =>
12061219
CopyWith$Fragment$PersonParent.stub(_res);
12071220
}
@@ -1224,6 +1237,7 @@ class Variables$Mutation$UpdatePerson {
12241237
Map<String, dynamic> _$data;
12251238

12261239
String get id => (_$data['id'] as String);
1240+
12271241
Map<String, dynamic> toJson() {
12281242
final result$data = <String, dynamic>{};
12291243
final l$id = id;
@@ -1236,6 +1250,7 @@ class Variables$Mutation$UpdatePerson {
12361250
this,
12371251
(i) => i,
12381252
);
1253+
12391254
@override
12401255
bool operator ==(Object other) {
12411256
if (identical(this, other)) {
@@ -1413,6 +1428,7 @@ class _CopyWithImpl$Mutation$UpdatePerson<TRes>
14131428
? _instance.$__typename
14141429
: ($__typename as String),
14151430
));
1431+
14161432
CopyWith$Mutation$UpdatePerson$updatePerson<TRes> get updatePerson {
14171433
final local$updatePerson = _instance.updatePerson;
14181434
return local$updatePerson == null
@@ -1433,6 +1449,7 @@ class _CopyWithStubImpl$Mutation$UpdatePerson<TRes>
14331449
String? $__typename,
14341450
}) =>
14351451
_res;
1452+
14361453
CopyWith$Mutation$UpdatePerson$updatePerson<TRes> get updatePerson =>
14371454
CopyWith$Mutation$UpdatePerson$updatePerson.stub(_res);
14381455
}
@@ -1847,6 +1864,7 @@ class Variables$Subscription$WatchPerson {
18471864
Map<String, dynamic> _$data;
18481865

18491866
String? get id => (_$data['id'] as String?);
1867+
18501868
Map<String, dynamic> toJson() {
18511869
final result$data = <String, dynamic>{};
18521870
if (_$data.containsKey('id')) {
@@ -1862,6 +1880,7 @@ class Variables$Subscription$WatchPerson {
18621880
this,
18631881
(i) => i,
18641882
);
1883+
18651884
@override
18661885
bool operator ==(Object other) {
18671886
if (identical(this, other)) {
@@ -2044,6 +2063,7 @@ class _CopyWithImpl$Subscription$WatchPerson<TRes>
20442063
? _instance.$__typename
20452064
: ($__typename as String),
20462065
));
2066+
20472067
CopyWith$Subscription$WatchPerson$watchPerson<TRes> get watchPerson {
20482068
final local$watchPerson = _instance.watchPerson;
20492069
return local$watchPerson == null
@@ -2064,6 +2084,7 @@ class _CopyWithStubImpl$Subscription$WatchPerson<TRes>
20642084
String? $__typename,
20652085
}) =>
20662086
_res;
2087+
20672088
CopyWith$Subscription$WatchPerson$watchPerson<TRes> get watchPerson =>
20682089
CopyWith$Subscription$WatchPerson$watchPerson.stub(_res);
20692090
}

packages/graphql_codegen/example/lib/schema.graphqls.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ class Input$UpdatePersonInput {
3636
Map<String, dynamic> _$data;
3737

3838
String get id => (_$data['id'] as String);
39+
3940
String? get full_name => (_$data['full_name'] as String?);
41+
4042
String? get nickname => (_$data['nickname'] as String?);
43+
4144
String? get website => (_$data['website'] as String?);
45+
4246
Map<String, dynamic> toJson() {
4347
final result$data = <String, dynamic>{};
4448
final l$id = id;
@@ -63,6 +67,7 @@ class Input$UpdatePersonInput {
6367
this,
6468
(i) => i,
6569
);
70+
6671
@override
6772
bool operator ==(Object other) {
6873
if (identical(this, other)) {

packages/graphql_codegen/example/pubspec.lock

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ packages:
125125
dependency: transitive
126126
description:
127127
name: code_builder
128-
sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189"
128+
sha256: b2151ce26a06171005b379ecff6e08d34c470180ffe16b8e14b6d52be292b55f
129129
url: "https://pub.dev"
130130
source: hosted
131-
version: "4.5.0"
131+
version: "4.8.0"
132132
collection:
133133
dependency: transitive
134134
description:
@@ -263,10 +263,10 @@ packages:
263263
dependency: transitive
264264
description:
265265
name: gql_code_builder
266-
sha256: "6e386a85f5d91daae82915337f566a43dfeb0a0df38caa372387fbc07d31b8c1"
266+
sha256: b70e17fe62af58c3a9a3dfd619bf0b07ca15afe4d285001fbcd0852a40538401
267267
url: "https://pub.dev"
268268
source: hosted
269-
version: "0.7.2"
269+
version: "0.9.1+1"
270270
gql_dedupe_link:
271271
dependency: transitive
272272
description:
@@ -315,6 +315,14 @@ packages:
315315
url: "https://pub.dev"
316316
source: hosted
317317
version: "1.0.0"
318+
gql_tristate_value:
319+
dependency: transitive
320+
description:
321+
name: gql_tristate_value
322+
sha256: ae045e7e272fbfd030084315140c683c9b032a9861a37165f68c2ecd8a759664
323+
url: "https://pub.dev"
324+
source: hosted
325+
version: "1.0.0"
318326
graphql:
319327
dependency: "direct main"
320328
description:

packages/graphql_codegen/pubspec.lock

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ packages:
125125
dependency: "direct main"
126126
description:
127127
name: code_builder
128-
sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189"
128+
sha256: b2151ce26a06171005b379ecff6e08d34c470180ffe16b8e14b6d52be292b55f
129129
url: "https://pub.dev"
130130
source: hosted
131-
version: "4.5.0"
131+
version: "4.8.0"
132132
collection:
133133
dependency: transitive
134134
description:
@@ -221,10 +221,10 @@ packages:
221221
dependency: "direct main"
222222
description:
223223
name: gql_code_builder
224-
sha256: "6e386a85f5d91daae82915337f566a43dfeb0a0df38caa372387fbc07d31b8c1"
224+
sha256: b70e17fe62af58c3a9a3dfd619bf0b07ca15afe4d285001fbcd0852a40538401
225225
url: "https://pub.dev"
226226
source: hosted
227-
version: "0.7.2"
227+
version: "0.9.1+1"
228228
gql_dedupe_link:
229229
dependency: transitive
230230
description:
@@ -273,6 +273,14 @@ packages:
273273
url: "https://pub.dev"
274274
source: hosted
275275
version: "1.0.0"
276+
gql_tristate_value:
277+
dependency: transitive
278+
description:
279+
name: gql_tristate_value
280+
sha256: ae045e7e272fbfd030084315140c683c9b032a9861a37165f68c2ecd8a759664
281+
url: "https://pub.dev"
282+
source: hosted
283+
version: "1.0.0"
276284
graphql:
277285
dependency: "direct dev"
278286
description:

packages/graphql_codegen/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
dart_style: ^2.0.1
1919
built_collection: ^5.0.0
2020
path: ^1.8.0
21-
gql_code_builder: ^0.7.1
21+
gql_code_builder: ^0.9.1
2222
recase: ^4.0.0
2323
json_annotation: ^4.8.0
2424
dev_dependencies:

packages/graphql_codegen/test/assets/add_typenames/schema.graphql.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ class _CopyWithImpl$Query$Q<TRes> implements CopyWith$Query$Q<TRes> {
586586
? _instance.$__typename
587587
: ($__typename as String),
588588
));
589+
589590
TRes docsWithTypename(
590591
Iterable<Query$Q$docsWithTypename?>? Function(
591592
Iterable<
@@ -599,6 +600,7 @@ class _CopyWithImpl$Query$Q<TRes> implements CopyWith$Query$Q<TRes> {
599600
e,
600601
(i) => i,
601602
)))?.toList());
603+
602604
TRes docsWihtoutTypename(
603605
Iterable<Query$Q$docsWihtoutTypename?>? Function(
604606
Iterable<
@@ -613,6 +615,7 @@ class _CopyWithImpl$Query$Q<TRes> implements CopyWith$Query$Q<TRes> {
613615
e,
614616
(i) => i,
615617
)))?.toList());
618+
616619
TRes docsWithAliasedTypename(
617620
Iterable<Query$Q$docsWithAliasedTypename?>? Function(
618621
Iterable<
@@ -627,6 +630,7 @@ class _CopyWithImpl$Query$Q<TRes> implements CopyWith$Query$Q<TRes> {
627630
e,
628631
(i) => i,
629632
)))?.toList());
633+
630634
TRes docsWithFragment(
631635
Iterable<Query$Q$docsWithFragment?>? Function(
632636
Iterable<
@@ -655,9 +659,13 @@ class _CopyWithStubImpl$Query$Q<TRes> implements CopyWith$Query$Q<TRes> {
655659
String? $__typename,
656660
}) =>
657661
_res;
662+
658663
docsWithTypename(_fn) => _res;
664+
659665
docsWihtoutTypename(_fn) => _res;
666+
660667
docsWithAliasedTypename(_fn) => _res;
668+
661669
docsWithFragment(_fn) => _res;
662670
}
663671

packages/graphql_codegen/test/assets/condition_example/fragments.graphql.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ class _CopyWithImpl$Fragment$AndCondition<TRes>
603603
? _instance.$__typename
604604
: ($__typename as String),
605605
));
606+
606607
CopyWith$Fragment$NonCompositeCondition<TRes> get left {
607608
final local$left = _instance.left;
608609
return CopyWith$Fragment$NonCompositeCondition(
@@ -629,8 +630,10 @@ class _CopyWithStubImpl$Fragment$AndCondition<TRes>
629630
String? $__typename,
630631
}) =>
631632
_res;
633+
632634
CopyWith$Fragment$NonCompositeCondition<TRes> get left =>
633635
CopyWith$Fragment$NonCompositeCondition.stub(_res);
636+
634637
CopyWith$Fragment$NonCompositeCondition<TRes> get right =>
635638
CopyWith$Fragment$NonCompositeCondition.stub(_res);
636639
}
@@ -1078,6 +1081,7 @@ class _CopyWithImpl$Fragment$CompositeCondition$$AndCondition<TRes>
10781081
? _instance.$__typename
10791082
: ($__typename as String),
10801083
));
1084+
10811085
CopyWith$Fragment$NonCompositeCondition<TRes> get left {
10821086
final local$left = _instance.left;
10831087
return CopyWith$Fragment$NonCompositeCondition(
@@ -1104,8 +1108,10 @@ class _CopyWithStubImpl$Fragment$CompositeCondition$$AndCondition<TRes>
11041108
String? $__typename,
11051109
}) =>
11061110
_res;
1111+
11071112
CopyWith$Fragment$NonCompositeCondition<TRes> get left =>
11081113
CopyWith$Fragment$NonCompositeCondition.stub(_res);
1114+
11091115
CopyWith$Fragment$NonCompositeCondition<TRes> get right =>
11101116
CopyWith$Fragment$NonCompositeCondition.stub(_res);
11111117
}

packages/graphql_codegen/test/assets/condition_example/query.graphql.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class _CopyWithImpl$Query$FetchShouldRender<TRes>
112112
? _instance.$__typename
113113
: ($__typename as String),
114114
));
115+
115116
CopyWith$Fragment$CompositeCondition<TRes> get shouldRender {
116117
final local$shouldRender = _instance.shouldRender;
117118
return CopyWith$Fragment$CompositeCondition(
@@ -130,6 +131,7 @@ class _CopyWithStubImpl$Query$FetchShouldRender<TRes>
130131
String? $__typename,
131132
}) =>
132133
_res;
134+
133135
CopyWith$Fragment$CompositeCondition<TRes> get shouldRender =>
134136
CopyWith$Fragment$CompositeCondition.stub(_res);
135137
}

0 commit comments

Comments
 (0)