diff --git a/packages/ferry/lib/src/fetch_policy_typed_link.dart b/packages/ferry/lib/src/fetch_policy_typed_link.dart index 4032d36b..fe35f74c 100644 --- a/packages/ferry/lib/src/fetch_policy_typed_link.dart +++ b/packages/ferry/lib/src/fetch_policy_typed_link.dart @@ -72,7 +72,8 @@ class FetchPolicyTypedLink extends TypedLink { .request(operationRequest) .doOnData(_removeOptimisticPatch) .doOnData(_writeToCache) - .doOnCancel(() => cache.removeOptimisticPatch(operationRequest)); + .doOnCancel(() => cache.removeOptimisticPatch(operationRequest)) + .concatWith([_cacheTypedLink.request(operationRequest).skip(1)]); case FetchPolicy.CacheOnly: return _cacheTypedLink.request(operationRequest); case FetchPolicy.CacheFirst: diff --git a/packages/ferry/test/typed_links/fetch_policy_typed_link_test.dart b/packages/ferry/test/typed_links/fetch_policy_typed_link_test.dart index 9859096e..b0af8bf6 100644 --- a/packages/ferry/test/typed_links/fetch_policy_typed_link_test.dart +++ b/packages/ferry/test/typed_links/fetch_policy_typed_link_test.dart @@ -12,6 +12,7 @@ import 'package:rxdart/rxdart.dart'; import 'package:ferry/src/fetch_policy_typed_link.dart'; import 'package:ferry_test_graphql2/queries/__generated__/human_with_args.req.gql.dart'; import 'package:ferry_test_graphql2/queries/__generated__/human_with_args.data.gql.dart'; +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.req.gql.dart'; import './fetch_policy_typed_link_test.mocks.dart'; @@ -50,10 +51,13 @@ void main() { late StreamController requestController; late TypedLink typedLink; late Cache cache; + late FetchPolicyTypedLink fetchPolicyTypedLink; setUp(() { requestController = StreamController(); cache = Cache(); + fetchPolicyTypedLink = FetchPolicyTypedLink(link: mockLink, cache: cache); + typedLink = TypedLink.from([ TypedLink.function( (req, [forward]) => requestController.stream @@ -62,7 +66,7 @@ void main() { (req) => forward!(req), ), ), - FetchPolicyTypedLink(link: mockLink, cache: cache), + fetchPolicyTypedLink, ]); }); @@ -164,6 +168,54 @@ void main() { ]), ); }); + + test('emit new event when cache changes', () async { + final modifiedName = 'modified name'; + final modifiedData = GHumanWithArgsData( + (b) => b + ..human.id = 'steve' + ..human.name = modifiedName + ..human.height = 1.88, + ); + + when(mockLink.request(any, any)).thenAnswer((_) => Stream.fromIterable([ + Response(data: data.toJson(), response: {}), + ])); + + final stream = fetchPolicyTypedLink.request(req); + + unawaited(expectLater( + stream, + emitsInOrder([ + // Data emitted from making a request. + equals( + OperationResponse( + operationRequest: req, + dataSource: DataSource.Link, + data: data, + ), + ), + // Data emitted because of changes in cache [writeFragment]. + equals( + OperationResponse( + operationRequest: req, + dataSource: DataSource.Cache, + data: modifiedData, + ), + ), + ]), + )); + + await pumpEventQueue(); + + final fragmentRequest = GHumanFragmentReq( + (b) => b.idFields = {'id': 'steve'}, + ); + final currentCacheData = cache.readFragment(fragmentRequest); + final modifiedCacheData = + currentCacheData!.rebuild((b) => b.name = modifiedName); + cache.writeFragment(fragmentRequest, modifiedCacheData); + }); }); group('.NetworkOnly', () { @@ -185,6 +237,54 @@ void main() { final second = await queue.next; expect(second.dataSource, equals(DataSource.Link)); }); + + test('emit new event when cache changes', () async { + final modifiedName = 'modified name'; + final modifiedData = GHumanWithArgsData( + (b) => b + ..human.id = 'steve' + ..human.name = modifiedName + ..human.height = 1.88, + ); + + when(mockLink.request(any, any)).thenAnswer((_) => Stream.fromIterable([ + Response(data: data.toJson(), response: {}), + ])); + + final stream = fetchPolicyTypedLink.request(req); + + unawaited(expectLater( + stream, + emitsInOrder([ + // Data emitted from making a request. + equals( + OperationResponse( + operationRequest: req, + dataSource: DataSource.Link, + data: data, + ), + ), + // Data emitted because of changes in cache [writeFragment]. + equals( + OperationResponse( + operationRequest: req, + dataSource: DataSource.Cache, + data: modifiedData, + ), + ), + ]), + )); + + await pumpEventQueue(); + + final fragmentRequest = GHumanFragmentReq( + (b) => b.idFields = {'id': 'steve'}, + ); + final currentCacheData = cache.readFragment(fragmentRequest); + final modifiedCacheData = + currentCacheData!.rebuild((b) => b.name = modifiedName); + cache.writeFragment(fragmentRequest, modifiedCacheData); + }); }); group('.CacheOnly', () { @@ -209,6 +309,56 @@ void main() { expect(response.dataSource, equals(DataSource.Cache)); expect(response.data, equals(data)); }); + + test('emit new event when cache changes', () async { + final modifiedName = 'modified name'; + final modifiedData = GHumanWithArgsData( + (b) => b + ..human.id = 'steve' + ..human.name = modifiedName + ..human.height = 1.88, + ); + + when(mockLink.request(any, any)).thenAnswer((_) => Stream.fromIterable([ + Response(data: data.toJson(), response: {}), + ])); + + final stream = fetchPolicyTypedLink.request(req); + // Inistal cache data. + cache.writeQuery(req, data); + + unawaited(expectLater( + stream, + emitsInOrder([ + // Initial data emitted from cache. + equals( + OperationResponse( + operationRequest: req, + dataSource: DataSource.Cache, + data: data, + ), + ), + // Data emitted because of changes in cache [writeFragment]. + equals( + OperationResponse( + operationRequest: req, + dataSource: DataSource.Cache, + data: modifiedData, + ), + ), + ]), + )); + + await pumpEventQueue(); + + final fragmentRequest = GHumanFragmentReq( + (b) => b.idFields = {'id': 'steve'}, + ); + final currentCacheData = cache.readFragment(fragmentRequest); + final modifiedCacheData = + currentCacheData!.rebuild((b) => b.name = modifiedName); + cache.writeFragment(fragmentRequest, modifiedCacheData); + }); }); group('.NoCache', () { diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.ast.gql.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.ast.gql.dart new file mode 100644 index 00000000..01a7a745 --- /dev/null +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.ast.gql.dart @@ -0,0 +1,78 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:gql/ast.dart' as _i1; + +const HumanFragment = _i1.FragmentDefinitionNode( + name: _i1.NameNode(value: 'HumanFragment'), + typeCondition: _i1.TypeConditionNode( + on: _i1.NamedTypeNode( + name: _i1.NameNode(value: 'Human'), + isNonNull: false, + )), + directives: [], + selectionSet: _i1.SelectionSetNode(selections: [ + _i1.FieldNode( + name: _i1.NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + _i1.FieldNode( + name: _i1.NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + _i1.FieldNode( + name: _i1.NameNode(value: 'height'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + _i1.FieldNode( + name: _i1.NameNode(value: 'friendsConnection'), + alias: null, + arguments: [ + _i1.ArgumentNode( + name: _i1.NameNode(value: 'first'), + value: _i1.IntValueNode(value: '10'), + ), + _i1.ArgumentNode( + name: _i1.NameNode(value: 'after'), + value: _i1.VariableNode(name: _i1.NameNode(value: 'friendsAfter')), + ), + ], + directives: [], + selectionSet: _i1.SelectionSetNode(selections: [ + _i1.FieldNode( + name: _i1.NameNode(value: 'friends'), + alias: null, + arguments: [], + directives: [], + selectionSet: _i1.SelectionSetNode(selections: [ + _i1.FieldNode( + name: _i1.NameNode(value: 'id'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + _i1.FieldNode( + name: _i1.NameNode(value: 'name'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ) + ]), + ), + ]), +); +const document = _i1.DocumentNode(definitions: [HumanFragment]); diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.data.gql.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.data.gql.dart new file mode 100644 index 00000000..08239d6d --- /dev/null +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.data.gql.dart @@ -0,0 +1,149 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:ferry_test_graphql2/schema/__generated__/serializers.gql.dart' + as _i1; + +part 'human_fragment.data.gql.g.dart'; + +abstract class GHumanFragment { + String get G__typename; + String get id; + String get name; + double? get height; + GHumanFragment_friendsConnection get friendsConnection; + Map toJson(); +} + +abstract class GHumanFragment_friendsConnection { + String get G__typename; + BuiltList? get friends; + Map toJson(); +} + +abstract class GHumanFragment_friendsConnection_friends { + String get G__typename; + String get id; + String get name; + Map toJson(); +} + +abstract class GHumanFragmentData + implements + Built, + GHumanFragment { + GHumanFragmentData._(); + + factory GHumanFragmentData( + [void Function(GHumanFragmentDataBuilder b) updates]) = + _$GHumanFragmentData; + + static void _initializeBuilder(GHumanFragmentDataBuilder b) => + b..G__typename = 'Human'; + + @override + @BuiltValueField(wireName: '__typename') + String get G__typename; + @override + String get id; + @override + String get name; + @override + double? get height; + @override + GHumanFragmentData_friendsConnection get friendsConnection; + static Serializer get serializer => + _$gHumanFragmentDataSerializer; + + @override + Map toJson() => (_i1.serializers.serializeWith( + GHumanFragmentData.serializer, + this, + ) as Map); + + static GHumanFragmentData? fromJson(Map json) => + _i1.serializers.deserializeWith( + GHumanFragmentData.serializer, + json, + ); +} + +abstract class GHumanFragmentData_friendsConnection + implements + Built, + GHumanFragment_friendsConnection { + GHumanFragmentData_friendsConnection._(); + + factory GHumanFragmentData_friendsConnection( + [void Function(GHumanFragmentData_friendsConnectionBuilder b) + updates]) = _$GHumanFragmentData_friendsConnection; + + static void _initializeBuilder( + GHumanFragmentData_friendsConnectionBuilder b) => + b..G__typename = 'FriendsConnection'; + + @override + @BuiltValueField(wireName: '__typename') + String get G__typename; + @override + BuiltList? get friends; + static Serializer get serializer => + _$gHumanFragmentDataFriendsConnectionSerializer; + + @override + Map toJson() => (_i1.serializers.serializeWith( + GHumanFragmentData_friendsConnection.serializer, + this, + ) as Map); + + static GHumanFragmentData_friendsConnection? fromJson( + Map json) => + _i1.serializers.deserializeWith( + GHumanFragmentData_friendsConnection.serializer, + json, + ); +} + +abstract class GHumanFragmentData_friendsConnection_friends + implements + Built, + GHumanFragment_friendsConnection_friends { + GHumanFragmentData_friendsConnection_friends._(); + + factory GHumanFragmentData_friendsConnection_friends( + [void Function(GHumanFragmentData_friendsConnection_friendsBuilder b) + updates]) = _$GHumanFragmentData_friendsConnection_friends; + + static void _initializeBuilder( + GHumanFragmentData_friendsConnection_friendsBuilder b) => + b..G__typename = 'Character'; + + @override + @BuiltValueField(wireName: '__typename') + String get G__typename; + @override + String get id; + @override + String get name; + static Serializer + get serializer => _$gHumanFragmentDataFriendsConnectionFriendsSerializer; + + @override + Map toJson() => (_i1.serializers.serializeWith( + GHumanFragmentData_friendsConnection_friends.serializer, + this, + ) as Map); + + static GHumanFragmentData_friendsConnection_friends? fromJson( + Map json) => + _i1.serializers.deserializeWith( + GHumanFragmentData_friendsConnection_friends.serializer, + json, + ); +} diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.data.gql.g.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.data.gql.g.dart new file mode 100644 index 00000000..30c2a09a --- /dev/null +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.data.gql.g.dart @@ -0,0 +1,637 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'human_fragment.data.gql.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +Serializer _$gHumanFragmentDataSerializer = + new _$GHumanFragmentDataSerializer(); +Serializer + _$gHumanFragmentDataFriendsConnectionSerializer = + new _$GHumanFragmentData_friendsConnectionSerializer(); +Serializer + _$gHumanFragmentDataFriendsConnectionFriendsSerializer = + new _$GHumanFragmentData_friendsConnection_friendsSerializer(); + +class _$GHumanFragmentDataSerializer + implements StructuredSerializer { + @override + final Iterable types = const [GHumanFragmentData, _$GHumanFragmentData]; + @override + final String wireName = 'GHumanFragmentData'; + + @override + Iterable serialize( + Serializers serializers, GHumanFragmentData object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + '__typename', + serializers.serialize(object.G__typename, + specifiedType: const FullType(String)), + 'id', + serializers.serialize(object.id, specifiedType: const FullType(String)), + 'name', + serializers.serialize(object.name, specifiedType: const FullType(String)), + 'friendsConnection', + serializers.serialize(object.friendsConnection, + specifiedType: const FullType(GHumanFragmentData_friendsConnection)), + ]; + Object? value; + value = object.height; + if (value != null) { + result + ..add('height') + ..add(serializers.serialize(value, + specifiedType: const FullType(double))); + } + return result; + } + + @override + GHumanFragmentData deserialize( + Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = new GHumanFragmentDataBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case '__typename': + result.G__typename = serializers.deserialize(value, + specifiedType: const FullType(String))! as String; + break; + case 'id': + result.id = serializers.deserialize(value, + specifiedType: const FullType(String))! as String; + break; + case 'name': + result.name = serializers.deserialize(value, + specifiedType: const FullType(String))! as String; + break; + case 'height': + result.height = serializers.deserialize(value, + specifiedType: const FullType(double)) as double?; + break; + case 'friendsConnection': + result.friendsConnection.replace(serializers.deserialize(value, + specifiedType: + const FullType(GHumanFragmentData_friendsConnection))! + as GHumanFragmentData_friendsConnection); + break; + } + } + + return result.build(); + } +} + +class _$GHumanFragmentData_friendsConnectionSerializer + implements StructuredSerializer { + @override + final Iterable types = const [ + GHumanFragmentData_friendsConnection, + _$GHumanFragmentData_friendsConnection + ]; + @override + final String wireName = 'GHumanFragmentData_friendsConnection'; + + @override + Iterable serialize( + Serializers serializers, GHumanFragmentData_friendsConnection object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + '__typename', + serializers.serialize(object.G__typename, + specifiedType: const FullType(String)), + ]; + Object? value; + value = object.friends; + if (value != null) { + result + ..add('friends') + ..add(serializers.serialize(value, + specifiedType: const FullType(BuiltList, const [ + const FullType.nullable( + GHumanFragmentData_friendsConnection_friends) + ]))); + } + return result; + } + + @override + GHumanFragmentData_friendsConnection deserialize( + Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = new GHumanFragmentData_friendsConnectionBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case '__typename': + result.G__typename = serializers.deserialize(value, + specifiedType: const FullType(String))! as String; + break; + case 'friends': + result.friends.replace(serializers.deserialize(value, + specifiedType: const FullType(BuiltList, const [ + const FullType.nullable( + GHumanFragmentData_friendsConnection_friends) + ]))! as BuiltList); + break; + } + } + + return result.build(); + } +} + +class _$GHumanFragmentData_friendsConnection_friendsSerializer + implements + StructuredSerializer { + @override + final Iterable types = const [ + GHumanFragmentData_friendsConnection_friends, + _$GHumanFragmentData_friendsConnection_friends + ]; + @override + final String wireName = 'GHumanFragmentData_friendsConnection_friends'; + + @override + Iterable serialize(Serializers serializers, + GHumanFragmentData_friendsConnection_friends object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + '__typename', + serializers.serialize(object.G__typename, + specifiedType: const FullType(String)), + 'id', + serializers.serialize(object.id, specifiedType: const FullType(String)), + 'name', + serializers.serialize(object.name, specifiedType: const FullType(String)), + ]; + + return result; + } + + @override + GHumanFragmentData_friendsConnection_friends deserialize( + Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = new GHumanFragmentData_friendsConnection_friendsBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case '__typename': + result.G__typename = serializers.deserialize(value, + specifiedType: const FullType(String))! as String; + break; + case 'id': + result.id = serializers.deserialize(value, + specifiedType: const FullType(String))! as String; + break; + case 'name': + result.name = serializers.deserialize(value, + specifiedType: const FullType(String))! as String; + break; + } + } + + return result.build(); + } +} + +class _$GHumanFragmentData extends GHumanFragmentData { + @override + final String G__typename; + @override + final String id; + @override + final String name; + @override + final double? height; + @override + final GHumanFragmentData_friendsConnection friendsConnection; + + factory _$GHumanFragmentData( + [void Function(GHumanFragmentDataBuilder)? updates]) => + (new GHumanFragmentDataBuilder()..update(updates))._build(); + + _$GHumanFragmentData._( + {required this.G__typename, + required this.id, + required this.name, + this.height, + required this.friendsConnection}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, r'GHumanFragmentData', 'G__typename'); + BuiltValueNullFieldError.checkNotNull(id, r'GHumanFragmentData', 'id'); + BuiltValueNullFieldError.checkNotNull(name, r'GHumanFragmentData', 'name'); + BuiltValueNullFieldError.checkNotNull( + friendsConnection, r'GHumanFragmentData', 'friendsConnection'); + } + + @override + GHumanFragmentData rebuild( + void Function(GHumanFragmentDataBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + GHumanFragmentDataBuilder toBuilder() => + new GHumanFragmentDataBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is GHumanFragmentData && + G__typename == other.G__typename && + id == other.id && + name == other.name && + height == other.height && + friendsConnection == other.friendsConnection; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, G__typename.hashCode); + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, height.hashCode); + _$hash = $jc(_$hash, friendsConnection.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'GHumanFragmentData') + ..add('G__typename', G__typename) + ..add('id', id) + ..add('name', name) + ..add('height', height) + ..add('friendsConnection', friendsConnection)) + .toString(); + } +} + +class GHumanFragmentDataBuilder + implements Builder { + _$GHumanFragmentData? _$v; + + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; + + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + double? _height; + double? get height => _$this._height; + set height(double? height) => _$this._height = height; + + GHumanFragmentData_friendsConnectionBuilder? _friendsConnection; + GHumanFragmentData_friendsConnectionBuilder get friendsConnection => + _$this._friendsConnection ??= + new GHumanFragmentData_friendsConnectionBuilder(); + set friendsConnection( + GHumanFragmentData_friendsConnectionBuilder? friendsConnection) => + _$this._friendsConnection = friendsConnection; + + GHumanFragmentDataBuilder() { + GHumanFragmentData._initializeBuilder(this); + } + + GHumanFragmentDataBuilder get _$this { + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _height = $v.height; + _friendsConnection = $v.friendsConnection.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(GHumanFragmentData other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$GHumanFragmentData; + } + + @override + void update(void Function(GHumanFragmentDataBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + GHumanFragmentData build() => _build(); + + _$GHumanFragmentData _build() { + _$GHumanFragmentData _$result; + try { + _$result = _$v ?? + new _$GHumanFragmentData._( + G__typename: BuiltValueNullFieldError.checkNotNull( + G__typename, r'GHumanFragmentData', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, r'GHumanFragmentData', 'id'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'GHumanFragmentData', 'name'), + height: height, + friendsConnection: friendsConnection.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'friendsConnection'; + friendsConnection.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'GHumanFragmentData', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$GHumanFragmentData_friendsConnection + extends GHumanFragmentData_friendsConnection { + @override + final String G__typename; + @override + final BuiltList? friends; + + factory _$GHumanFragmentData_friendsConnection( + [void Function(GHumanFragmentData_friendsConnectionBuilder)? + updates]) => + (new GHumanFragmentData_friendsConnectionBuilder()..update(updates)) + ._build(); + + _$GHumanFragmentData_friendsConnection._( + {required this.G__typename, this.friends}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + G__typename, r'GHumanFragmentData_friendsConnection', 'G__typename'); + } + + @override + GHumanFragmentData_friendsConnection rebuild( + void Function(GHumanFragmentData_friendsConnectionBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + GHumanFragmentData_friendsConnectionBuilder toBuilder() => + new GHumanFragmentData_friendsConnectionBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is GHumanFragmentData_friendsConnection && + G__typename == other.G__typename && + friends == other.friends; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, G__typename.hashCode); + _$hash = $jc(_$hash, friends.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'GHumanFragmentData_friendsConnection') + ..add('G__typename', G__typename) + ..add('friends', friends)) + .toString(); + } +} + +class GHumanFragmentData_friendsConnectionBuilder + implements + Builder { + _$GHumanFragmentData_friendsConnection? _$v; + + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; + + ListBuilder? _friends; + ListBuilder get friends => + _$this._friends ??= + new ListBuilder(); + set friends( + ListBuilder? + friends) => + _$this._friends = friends; + + GHumanFragmentData_friendsConnectionBuilder() { + GHumanFragmentData_friendsConnection._initializeBuilder(this); + } + + GHumanFragmentData_friendsConnectionBuilder get _$this { + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _friends = $v.friends?.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(GHumanFragmentData_friendsConnection other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$GHumanFragmentData_friendsConnection; + } + + @override + void update( + void Function(GHumanFragmentData_friendsConnectionBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + GHumanFragmentData_friendsConnection build() => _build(); + + _$GHumanFragmentData_friendsConnection _build() { + _$GHumanFragmentData_friendsConnection _$result; + try { + _$result = _$v ?? + new _$GHumanFragmentData_friendsConnection._( + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + r'GHumanFragmentData_friendsConnection', 'G__typename'), + friends: _friends?.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'friends'; + _friends?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'GHumanFragmentData_friendsConnection', + _$failedField, + e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +class _$GHumanFragmentData_friendsConnection_friends + extends GHumanFragmentData_friendsConnection_friends { + @override + final String G__typename; + @override + final String id; + @override + final String name; + + factory _$GHumanFragmentData_friendsConnection_friends( + [void Function(GHumanFragmentData_friendsConnection_friendsBuilder)? + updates]) => + (new GHumanFragmentData_friendsConnection_friendsBuilder() + ..update(updates)) + ._build(); + + _$GHumanFragmentData_friendsConnection_friends._( + {required this.G__typename, required this.id, required this.name}) + : super._() { + BuiltValueNullFieldError.checkNotNull(G__typename, + r'GHumanFragmentData_friendsConnection_friends', 'G__typename'); + BuiltValueNullFieldError.checkNotNull( + id, r'GHumanFragmentData_friendsConnection_friends', 'id'); + BuiltValueNullFieldError.checkNotNull( + name, r'GHumanFragmentData_friendsConnection_friends', 'name'); + } + + @override + GHumanFragmentData_friendsConnection_friends rebuild( + void Function(GHumanFragmentData_friendsConnection_friendsBuilder) + updates) => + (toBuilder()..update(updates)).build(); + + @override + GHumanFragmentData_friendsConnection_friendsBuilder toBuilder() => + new GHumanFragmentData_friendsConnection_friendsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is GHumanFragmentData_friendsConnection_friends && + G__typename == other.G__typename && + id == other.id && + name == other.name; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, G__typename.hashCode); + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper( + r'GHumanFragmentData_friendsConnection_friends') + ..add('G__typename', G__typename) + ..add('id', id) + ..add('name', name)) + .toString(); + } +} + +class GHumanFragmentData_friendsConnection_friendsBuilder + implements + Builder { + _$GHumanFragmentData_friendsConnection_friends? _$v; + + String? _G__typename; + String? get G__typename => _$this._G__typename; + set G__typename(String? G__typename) => _$this._G__typename = G__typename; + + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; + + String? _name; + String? get name => _$this._name; + set name(String? name) => _$this._name = name; + + GHumanFragmentData_friendsConnection_friendsBuilder() { + GHumanFragmentData_friendsConnection_friends._initializeBuilder(this); + } + + GHumanFragmentData_friendsConnection_friendsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _G__typename = $v.G__typename; + _id = $v.id; + _name = $v.name; + _$v = null; + } + return this; + } + + @override + void replace(GHumanFragmentData_friendsConnection_friends other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$GHumanFragmentData_friendsConnection_friends; + } + + @override + void update( + void Function(GHumanFragmentData_friendsConnection_friendsBuilder)? + updates) { + if (updates != null) updates(this); + } + + @override + GHumanFragmentData_friendsConnection_friends build() => _build(); + + _$GHumanFragmentData_friendsConnection_friends _build() { + final _$result = _$v ?? + new _$GHumanFragmentData_friendsConnection_friends._( + G__typename: BuiltValueNullFieldError.checkNotNull(G__typename, + r'GHumanFragmentData_friendsConnection_friends', 'G__typename'), + id: BuiltValueNullFieldError.checkNotNull( + id, r'GHumanFragmentData_friendsConnection_friends', 'id'), + name: BuiltValueNullFieldError.checkNotNull( + name, r'GHumanFragmentData_friendsConnection_friends', 'name')); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.req.gql.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.req.gql.dart new file mode 100644 index 00000000..536ce01b --- /dev/null +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.req.gql.dart @@ -0,0 +1,65 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:ferry_exec/ferry_exec.dart' as _i1; +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.ast.gql.dart' + as _i4; +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.data.gql.dart' + as _i2; +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.var.gql.dart' + as _i3; +import 'package:ferry_test_graphql2/schema/__generated__/serializers.gql.dart' + as _i6; +import 'package:gql/ast.dart' as _i5; + +part 'human_fragment.req.gql.g.dart'; + +abstract class GHumanFragmentReq + implements + Built, + _i1.FragmentRequest<_i2.GHumanFragmentData, _i3.GHumanFragmentVars> { + GHumanFragmentReq._(); + + factory GHumanFragmentReq( + [void Function(GHumanFragmentReqBuilder b) updates]) = + _$GHumanFragmentReq; + + static void _initializeBuilder(GHumanFragmentReqBuilder b) => b + ..document = _i4.document + ..fragmentName = 'HumanFragment'; + + @override + _i3.GHumanFragmentVars get vars; + @override + _i5.DocumentNode get document; + @override + String? get fragmentName; + @override + Map get idFields; + @override + _i2.GHumanFragmentData? parseData(Map json) => + _i2.GHumanFragmentData.fromJson(json); + + @override + Map varsToJson() => vars.toJson(); + + @override + Map dataToJson(_i2.GHumanFragmentData data) => data.toJson(); + + static Serializer get serializer => + _$gHumanFragmentReqSerializer; + + Map toJson() => (_i6.serializers.serializeWith( + GHumanFragmentReq.serializer, + this, + ) as Map); + + static GHumanFragmentReq? fromJson(Map json) => + _i6.serializers.deserializeWith( + GHumanFragmentReq.serializer, + json, + ); +} diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.req.gql.g.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.req.gql.g.dart new file mode 100644 index 00000000..cf00273c --- /dev/null +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.req.gql.g.dart @@ -0,0 +1,230 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'human_fragment.req.gql.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +Serializer _$gHumanFragmentReqSerializer = + new _$GHumanFragmentReqSerializer(); + +class _$GHumanFragmentReqSerializer + implements StructuredSerializer { + @override + final Iterable types = const [GHumanFragmentReq, _$GHumanFragmentReq]; + @override + final String wireName = 'GHumanFragmentReq'; + + @override + Iterable serialize(Serializers serializers, GHumanFragmentReq object, + {FullType specifiedType = FullType.unspecified}) { + final result = [ + 'vars', + serializers.serialize(object.vars, + specifiedType: const FullType(_i3.GHumanFragmentVars)), + 'document', + serializers.serialize(object.document, + specifiedType: const FullType(_i5.DocumentNode)), + 'idFields', + serializers.serialize(object.idFields, + specifiedType: const FullType( + Map, const [const FullType(String), const FullType(dynamic)])), + ]; + Object? value; + value = object.fragmentName; + if (value != null) { + result + ..add('fragmentName') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } + return result; + } + + @override + GHumanFragmentReq deserialize( + Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = new GHumanFragmentReqBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'vars': + result.vars.replace(serializers.deserialize(value, + specifiedType: const FullType(_i3.GHumanFragmentVars))! + as _i3.GHumanFragmentVars); + break; + case 'document': + result.document = serializers.deserialize(value, + specifiedType: const FullType(_i5.DocumentNode))! + as _i5.DocumentNode; + break; + case 'fragmentName': + result.fragmentName = serializers.deserialize(value, + specifiedType: const FullType(String)) as String?; + break; + case 'idFields': + result.idFields = serializers.deserialize(value, + specifiedType: const FullType(Map, const [ + const FullType(String), + const FullType(dynamic) + ]))! as Map; + break; + } + } + + return result.build(); + } +} + +class _$GHumanFragmentReq extends GHumanFragmentReq { + @override + final _i3.GHumanFragmentVars vars; + @override + final _i5.DocumentNode document; + @override + final String? fragmentName; + @override + final Map idFields; + + factory _$GHumanFragmentReq( + [void Function(GHumanFragmentReqBuilder)? updates]) => + (new GHumanFragmentReqBuilder()..update(updates))._build(); + + _$GHumanFragmentReq._( + {required this.vars, + required this.document, + this.fragmentName, + required this.idFields}) + : super._() { + BuiltValueNullFieldError.checkNotNull(vars, r'GHumanFragmentReq', 'vars'); + BuiltValueNullFieldError.checkNotNull( + document, r'GHumanFragmentReq', 'document'); + BuiltValueNullFieldError.checkNotNull( + idFields, r'GHumanFragmentReq', 'idFields'); + } + + @override + GHumanFragmentReq rebuild(void Function(GHumanFragmentReqBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + GHumanFragmentReqBuilder toBuilder() => + new GHumanFragmentReqBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is GHumanFragmentReq && + vars == other.vars && + document == other.document && + fragmentName == other.fragmentName && + idFields == other.idFields; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, vars.hashCode); + _$hash = $jc(_$hash, document.hashCode); + _$hash = $jc(_$hash, fragmentName.hashCode); + _$hash = $jc(_$hash, idFields.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'GHumanFragmentReq') + ..add('vars', vars) + ..add('document', document) + ..add('fragmentName', fragmentName) + ..add('idFields', idFields)) + .toString(); + } +} + +class GHumanFragmentReqBuilder + implements Builder { + _$GHumanFragmentReq? _$v; + + _i3.GHumanFragmentVarsBuilder? _vars; + _i3.GHumanFragmentVarsBuilder get vars => + _$this._vars ??= new _i3.GHumanFragmentVarsBuilder(); + set vars(_i3.GHumanFragmentVarsBuilder? vars) => _$this._vars = vars; + + _i5.DocumentNode? _document; + _i5.DocumentNode? get document => _$this._document; + set document(_i5.DocumentNode? document) => _$this._document = document; + + String? _fragmentName; + String? get fragmentName => _$this._fragmentName; + set fragmentName(String? fragmentName) => _$this._fragmentName = fragmentName; + + Map? _idFields; + Map? get idFields => _$this._idFields; + set idFields(Map? idFields) => _$this._idFields = idFields; + + GHumanFragmentReqBuilder() { + GHumanFragmentReq._initializeBuilder(this); + } + + GHumanFragmentReqBuilder get _$this { + final $v = _$v; + if ($v != null) { + _vars = $v.vars.toBuilder(); + _document = $v.document; + _fragmentName = $v.fragmentName; + _idFields = $v.idFields; + _$v = null; + } + return this; + } + + @override + void replace(GHumanFragmentReq other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$GHumanFragmentReq; + } + + @override + void update(void Function(GHumanFragmentReqBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + GHumanFragmentReq build() => _build(); + + _$GHumanFragmentReq _build() { + _$GHumanFragmentReq _$result; + try { + _$result = _$v ?? + new _$GHumanFragmentReq._( + vars: vars.build(), + document: BuiltValueNullFieldError.checkNotNull( + document, r'GHumanFragmentReq', 'document'), + fragmentName: fragmentName, + idFields: BuiltValueNullFieldError.checkNotNull( + idFields, r'GHumanFragmentReq', 'idFields')); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'vars'; + vars.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'GHumanFragmentReq', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.var.gql.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.var.gql.dart new file mode 100644 index 00000000..f7c99f62 --- /dev/null +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.var.gql.dart @@ -0,0 +1,34 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; +import 'package:ferry_test_graphql2/schema/__generated__/serializers.gql.dart' + as _i1; + +part 'human_fragment.var.gql.g.dart'; + +abstract class GHumanFragmentVars + implements Built { + GHumanFragmentVars._(); + + factory GHumanFragmentVars( + [void Function(GHumanFragmentVarsBuilder b) updates]) = + _$GHumanFragmentVars; + + String? get after; + static Serializer get serializer => + _$gHumanFragmentVarsSerializer; + + Map toJson() => (_i1.serializers.serializeWith( + GHumanFragmentVars.serializer, + this, + ) as Map); + + static GHumanFragmentVars? fromJson(Map json) => + _i1.serializers.deserializeWith( + GHumanFragmentVars.serializer, + json, + ); +} diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.var.gql.g.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.var.gql.g.dart new file mode 100644 index 00000000..2539d1c8 --- /dev/null +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/human_fragment.var.gql.g.dart @@ -0,0 +1,139 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'human_fragment.var.gql.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +Serializer _$gHumanFragmentVarsSerializer = + new _$GHumanFragmentVarsSerializer(); + +class _$GHumanFragmentVarsSerializer + implements StructuredSerializer { + @override + final Iterable types = const [GHumanFragmentVars, _$GHumanFragmentVars]; + @override + final String wireName = 'GHumanFragmentVars'; + + @override + Iterable serialize( + Serializers serializers, GHumanFragmentVars object, + {FullType specifiedType = FullType.unspecified}) { + final result = []; + Object? value; + value = object.after; + if (value != null) { + result + ..add('after') + ..add(serializers.serialize(value, + specifiedType: const FullType(String))); + } + return result; + } + + @override + GHumanFragmentVars deserialize( + Serializers serializers, Iterable serialized, + {FullType specifiedType = FullType.unspecified}) { + final result = new GHumanFragmentVarsBuilder(); + + final iterator = serialized.iterator; + while (iterator.moveNext()) { + final key = iterator.current! as String; + iterator.moveNext(); + final Object? value = iterator.current; + switch (key) { + case 'after': + result.after = serializers.deserialize(value, + specifiedType: const FullType(String)) as String?; + break; + } + } + + return result.build(); + } +} + +class _$GHumanFragmentVars extends GHumanFragmentVars { + @override + final String? after; + + factory _$GHumanFragmentVars( + [void Function(GHumanFragmentVarsBuilder)? updates]) => + (new GHumanFragmentVarsBuilder()..update(updates))._build(); + + _$GHumanFragmentVars._({this.after}) : super._(); + + @override + GHumanFragmentVars rebuild( + void Function(GHumanFragmentVarsBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + GHumanFragmentVarsBuilder toBuilder() => + new GHumanFragmentVarsBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is GHumanFragmentVars && after == other.after; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, after.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'GHumanFragmentVars') + ..add('after', after)) + .toString(); + } +} + +class GHumanFragmentVarsBuilder + implements Builder { + _$GHumanFragmentVars? _$v; + + String? _after; + String? get after => _$this._after; + set after(String? after) => _$this._after = after; + + GHumanFragmentVarsBuilder(); + + GHumanFragmentVarsBuilder get _$this { + final $v = _$v; + if ($v != null) { + _after = $v.after; + _$v = null; + } + return this; + } + + @override + void replace(GHumanFragmentVars other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$GHumanFragmentVars; + } + + @override + void update(void Function(GHumanFragmentVarsBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + GHumanFragmentVars build() => _build(); + + _$GHumanFragmentVars _build() { + final _$result = _$v ?? new _$GHumanFragmentVars._(after: after); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.data.gql.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.data.gql.dart index 3f51e9d3..391a47b0 100644 --- a/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.data.gql.dart @@ -23,7 +23,8 @@ abstract class GReviewFragmentData GReviewFragmentData._(); factory GReviewFragmentData( - [Function(GReviewFragmentDataBuilder b) updates]) = _$GReviewFragmentData; + [void Function(GReviewFragmentDataBuilder b) updates]) = + _$GReviewFragmentData; static void _initializeBuilder(GReviewFragmentDataBuilder b) => b..G__typename = 'Review'; diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.req.gql.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.req.gql.dart index accbe4b4..57bbbdce 100644 --- a/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.req.gql.dart @@ -23,7 +23,8 @@ abstract class GReviewFragmentReq _i1.FragmentRequest<_i2.GReviewFragmentData, _i3.GReviewFragmentVars> { GReviewFragmentReq._(); - factory GReviewFragmentReq([Function(GReviewFragmentReqBuilder b) updates]) = + factory GReviewFragmentReq( + [void Function(GReviewFragmentReqBuilder b) updates]) = _$GReviewFragmentReq; static void _initializeBuilder(GReviewFragmentReqBuilder b) => b diff --git a/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.var.gql.dart b/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.var.gql.dart index d386bc88..c4b02ccf 100644 --- a/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/fragments/__generated__/review_fragment.var.gql.dart @@ -14,7 +14,8 @@ abstract class GReviewFragmentVars GReviewFragmentVars._(); factory GReviewFragmentVars( - [Function(GReviewFragmentVarsBuilder b) updates]) = _$GReviewFragmentVars; + [void Function(GReviewFragmentVarsBuilder b) updates]) = + _$GReviewFragmentVars; static Serializer get serializer => _$gReviewFragmentVarsSerializer; diff --git a/packages/ferry_test_graphql2/lib/fragments/human_fragment.graphql b/packages/ferry_test_graphql2/lib/fragments/human_fragment.graphql new file mode 100644 index 00000000..2bb04cfb --- /dev/null +++ b/packages/ferry_test_graphql2/lib/fragments/human_fragment.graphql @@ -0,0 +1,11 @@ +fragment HumanFragment on Human { + id + name + height + friendsConnection(first: 10, after: $friendsAfter) { + friends { + id + name + } + } +} diff --git a/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.data.gql.dart b/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.data.gql.dart index b4c2a621..8c5968e8 100644 --- a/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.data.gql.dart @@ -15,7 +15,8 @@ abstract class GCreateReviewData implements Built { GCreateReviewData._(); - factory GCreateReviewData([Function(GCreateReviewDataBuilder b) updates]) = + factory GCreateReviewData( + [void Function(GCreateReviewDataBuilder b) updates]) = _$GCreateReviewData; static void _initializeBuilder(GCreateReviewDataBuilder b) => @@ -46,7 +47,7 @@ abstract class GCreateReviewData_createReview GCreateReviewData_createReview._(); factory GCreateReviewData_createReview( - [Function(GCreateReviewData_createReviewBuilder b) updates]) = + [void Function(GCreateReviewData_createReviewBuilder b) updates]) = _$GCreateReviewData_createReview; static void _initializeBuilder(GCreateReviewData_createReviewBuilder b) => diff --git a/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.req.gql.dart b/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.req.gql.dart index 6a519879..004b97df 100644 --- a/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.req.gql.dart @@ -23,7 +23,7 @@ abstract class GCreateReviewReq _i1.OperationRequest<_i2.GCreateReviewData, _i3.GCreateReviewVars> { GCreateReviewReq._(); - factory GCreateReviewReq([Function(GCreateReviewReqBuilder b) updates]) = + factory GCreateReviewReq([void Function(GCreateReviewReqBuilder b) updates]) = _$GCreateReviewReq; static void _initializeBuilder(GCreateReviewReqBuilder b) => b @@ -41,6 +41,7 @@ abstract class GCreateReviewReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -62,6 +63,9 @@ abstract class GCreateReviewReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GCreateReviewData? parseData(Map json) => _i2.GCreateReviewData.fromJson(json); diff --git a/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.req.gql.g.dart b/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.req.gql.g.dart index a5e2f3a8..9a701340 100644 --- a/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.req.gql.g.dart @@ -147,6 +147,8 @@ class _$GCreateReviewReq extends GCreateReviewReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GCreateReviewReq( [void Function(GCreateReviewReqBuilder)? updates]) => @@ -161,7 +163,8 @@ class _$GCreateReviewReq extends GCreateReviewReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull(vars, r'GCreateReviewReq', 'vars'); BuiltValueNullFieldError.checkNotNull( @@ -191,7 +194,8 @@ class _$GCreateReviewReq extends GCreateReviewReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -206,6 +210,7 @@ class _$GCreateReviewReq extends GCreateReviewReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -221,7 +226,8 @@ class _$GCreateReviewReq extends GCreateReviewReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -282,6 +288,10 @@ class GCreateReviewReqBuilder set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GCreateReviewReqBuilder() { GCreateReviewReq._initializeBuilder(this); } @@ -298,6 +308,7 @@ class GCreateReviewReqBuilder _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -332,7 +343,8 @@ class GCreateReviewReqBuilder updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, r'GCreateReviewReq', 'executeOnListen')); + executeOnListen, r'GCreateReviewReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.var.gql.dart b/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.var.gql.dart index fa311ac6..2d649f81 100644 --- a/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/mutations/__generated__/create_review.var.gql.dart @@ -15,7 +15,8 @@ abstract class GCreateReviewVars implements Built { GCreateReviewVars._(); - factory GCreateReviewVars([Function(GCreateReviewVarsBuilder b) updates]) = + factory GCreateReviewVars( + [void Function(GCreateReviewVarsBuilder b) updates]) = _$GCreateReviewVars; _i1.GEpisode? get episode; diff --git a/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.data.gql.dart b/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.data.gql.dart index bb0c9162..c18623bd 100644 --- a/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.data.gql.dart @@ -17,7 +17,8 @@ abstract class GReviewWithDateData GReviewWithDateData._(); factory GReviewWithDateData( - [Function(GReviewWithDateDataBuilder b) updates]) = _$GReviewWithDateData; + [void Function(GReviewWithDateDataBuilder b) updates]) = + _$GReviewWithDateData; static void _initializeBuilder(GReviewWithDateDataBuilder b) => b..G__typename = 'Mutation'; @@ -47,7 +48,7 @@ abstract class GReviewWithDateData_createReview GReviewWithDateData_createReview._(); factory GReviewWithDateData_createReview( - [Function(GReviewWithDateData_createReviewBuilder b) updates]) = + [void Function(GReviewWithDateData_createReviewBuilder b) updates]) = _$GReviewWithDateData_createReview; static void _initializeBuilder(GReviewWithDateData_createReviewBuilder b) => diff --git a/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.req.gql.dart b/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.req.gql.dart index 480bf819..3f60f447 100644 --- a/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.req.gql.dart @@ -23,7 +23,8 @@ abstract class GReviewWithDateReq _i1.OperationRequest<_i2.GReviewWithDateData, _i3.GReviewWithDateVars> { GReviewWithDateReq._(); - factory GReviewWithDateReq([Function(GReviewWithDateReqBuilder b) updates]) = + factory GReviewWithDateReq( + [void Function(GReviewWithDateReqBuilder b) updates]) = _$GReviewWithDateReq; static void _initializeBuilder(GReviewWithDateReqBuilder b) => b @@ -41,6 +42,7 @@ abstract class GReviewWithDateReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -62,6 +64,9 @@ abstract class GReviewWithDateReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GReviewWithDateData? parseData(Map json) => _i2.GReviewWithDateData.fromJson(json); diff --git a/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.req.gql.g.dart b/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.req.gql.g.dart index c27ea74f..b39fe0c3 100644 --- a/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.req.gql.g.dart @@ -148,6 +148,8 @@ class _$GReviewWithDateReq extends GReviewWithDateReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GReviewWithDateReq( [void Function(GReviewWithDateReqBuilder)? updates]) => @@ -162,7 +164,8 @@ class _$GReviewWithDateReq extends GReviewWithDateReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull(vars, r'GReviewWithDateReq', 'vars'); BuiltValueNullFieldError.checkNotNull( @@ -193,7 +196,8 @@ class _$GReviewWithDateReq extends GReviewWithDateReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -208,6 +212,7 @@ class _$GReviewWithDateReq extends GReviewWithDateReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -223,7 +228,8 @@ class _$GReviewWithDateReq extends GReviewWithDateReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -284,6 +290,10 @@ class GReviewWithDateReqBuilder set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GReviewWithDateReqBuilder() { GReviewWithDateReq._initializeBuilder(this); } @@ -300,6 +310,7 @@ class GReviewWithDateReqBuilder _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -334,7 +345,8 @@ class GReviewWithDateReqBuilder updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, r'GReviewWithDateReq', 'executeOnListen')); + executeOnListen, r'GReviewWithDateReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.var.gql.dart b/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.var.gql.dart index 1e23997f..96b66f26 100644 --- a/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/mutations/__generated__/review_with_date_scalar.var.gql.dart @@ -16,7 +16,8 @@ abstract class GReviewWithDateVars GReviewWithDateVars._(); factory GReviewWithDateVars( - [Function(GReviewWithDateVarsBuilder b) updates]) = _$GReviewWithDateVars; + [void Function(GReviewWithDateVarsBuilder b) updates]) = + _$GReviewWithDateVars; _i1.GEpisode? get episode; _i1.GReviewInput get review; diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.data.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.data.gql.dart index f69f7d5d..b2b0c90d 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.data.gql.dart @@ -16,7 +16,7 @@ abstract class GAliasedHeroData implements Built { GAliasedHeroData._(); - factory GAliasedHeroData([Function(GAliasedHeroDataBuilder b) updates]) = + factory GAliasedHeroData([void Function(GAliasedHeroDataBuilder b) updates]) = _$GAliasedHeroData; static void _initializeBuilder(GAliasedHeroDataBuilder b) => @@ -47,7 +47,7 @@ abstract class GAliasedHeroData_empireHero GAliasedHeroData_empireHero._(); factory GAliasedHeroData_empireHero( - [Function(GAliasedHeroData_empireHeroBuilder b) updates]) = + [void Function(GAliasedHeroData_empireHeroBuilder b) updates]) = _$GAliasedHeroData_empireHero; static void _initializeBuilder(GAliasedHeroData_empireHeroBuilder b) => @@ -79,7 +79,7 @@ abstract class GAliasedHeroData_jediHero GAliasedHeroData_jediHero._(); factory GAliasedHeroData_jediHero( - [Function(GAliasedHeroData_jediHeroBuilder b) updates]) = + [void Function(GAliasedHeroData_jediHeroBuilder b) updates]) = _$GAliasedHeroData_jediHero; static void _initializeBuilder(GAliasedHeroData_jediHeroBuilder b) => diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.req.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.req.gql.dart index 3cc1fae2..1ba8c717 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.req.gql.dart @@ -23,7 +23,7 @@ abstract class GAliasedHeroReq _i1.OperationRequest<_i2.GAliasedHeroData, _i3.GAliasedHeroVars> { GAliasedHeroReq._(); - factory GAliasedHeroReq([Function(GAliasedHeroReqBuilder b) updates]) = + factory GAliasedHeroReq([void Function(GAliasedHeroReqBuilder b) updates]) = _$GAliasedHeroReq; static void _initializeBuilder(GAliasedHeroReqBuilder b) => b @@ -41,6 +41,7 @@ abstract class GAliasedHeroReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -62,6 +63,9 @@ abstract class GAliasedHeroReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GAliasedHeroData? parseData(Map json) => _i2.GAliasedHeroData.fromJson(json); diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.req.gql.g.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.req.gql.g.dart index a7a86fb3..f05a9816 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.req.gql.g.dart @@ -147,6 +147,8 @@ class _$GAliasedHeroReq extends GAliasedHeroReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GAliasedHeroReq([void Function(GAliasedHeroReqBuilder)? updates]) => (new GAliasedHeroReqBuilder()..update(updates))._build(); @@ -160,7 +162,8 @@ class _$GAliasedHeroReq extends GAliasedHeroReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull(vars, r'GAliasedHeroReq', 'vars'); BuiltValueNullFieldError.checkNotNull( @@ -190,7 +193,8 @@ class _$GAliasedHeroReq extends GAliasedHeroReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -205,6 +209,7 @@ class _$GAliasedHeroReq extends GAliasedHeroReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -220,7 +225,8 @@ class _$GAliasedHeroReq extends GAliasedHeroReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -280,6 +286,10 @@ class GAliasedHeroReqBuilder set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GAliasedHeroReqBuilder() { GAliasedHeroReq._initializeBuilder(this); } @@ -296,6 +306,7 @@ class GAliasedHeroReqBuilder _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -330,7 +341,8 @@ class GAliasedHeroReqBuilder updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, r'GAliasedHeroReq', 'executeOnListen')); + executeOnListen, r'GAliasedHeroReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.var.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.var.gql.dart index d2c67498..f1219a57 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/aliased_hero.var.gql.dart @@ -15,7 +15,7 @@ abstract class GAliasedHeroVars implements Built { GAliasedHeroVars._(); - factory GAliasedHeroVars([Function(GAliasedHeroVarsBuilder b) updates]) = + factory GAliasedHeroVars([void Function(GAliasedHeroVarsBuilder b) updates]) = _$GAliasedHeroVars; _i1.GEpisode get ep; diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.data.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.data.gql.dart index ddde75d6..05035ae8 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.data.gql.dart @@ -13,7 +13,7 @@ abstract class GHeroNoVarsData implements Built { GHeroNoVarsData._(); - factory GHeroNoVarsData([Function(GHeroNoVarsDataBuilder b) updates]) = + factory GHeroNoVarsData([void Function(GHeroNoVarsDataBuilder b) updates]) = _$GHeroNoVarsData; static void _initializeBuilder(GHeroNoVarsDataBuilder b) => @@ -42,7 +42,7 @@ abstract class GHeroNoVarsData_hero GHeroNoVarsData_hero._(); factory GHeroNoVarsData_hero( - [Function(GHeroNoVarsData_heroBuilder b) updates]) = + [void Function(GHeroNoVarsData_heroBuilder b) updates]) = _$GHeroNoVarsData_hero; static void _initializeBuilder(GHeroNoVarsData_heroBuilder b) => diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.req.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.req.gql.dart index e29fdb63..00f6f7c9 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.req.gql.dart @@ -23,7 +23,7 @@ abstract class GHeroNoVarsReq _i1.OperationRequest<_i2.GHeroNoVarsData, _i3.GHeroNoVarsVars> { GHeroNoVarsReq._(); - factory GHeroNoVarsReq([Function(GHeroNoVarsReqBuilder b) updates]) = + factory GHeroNoVarsReq([void Function(GHeroNoVarsReqBuilder b) updates]) = _$GHeroNoVarsReq; static void _initializeBuilder(GHeroNoVarsReqBuilder b) => b @@ -41,6 +41,7 @@ abstract class GHeroNoVarsReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -62,6 +63,9 @@ abstract class GHeroNoVarsReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GHeroNoVarsData? parseData(Map json) => _i2.GHeroNoVarsData.fromJson(json); diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.req.gql.g.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.req.gql.g.dart index f2c5d947..f0ed55fd 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.req.gql.g.dart @@ -147,6 +147,8 @@ class _$GHeroNoVarsReq extends GHeroNoVarsReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GHeroNoVarsReq([void Function(GHeroNoVarsReqBuilder)? updates]) => (new GHeroNoVarsReqBuilder()..update(updates))._build(); @@ -160,7 +162,8 @@ class _$GHeroNoVarsReq extends GHeroNoVarsReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull(vars, r'GHeroNoVarsReq', 'vars'); BuiltValueNullFieldError.checkNotNull( @@ -190,7 +193,8 @@ class _$GHeroNoVarsReq extends GHeroNoVarsReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -205,6 +209,7 @@ class _$GHeroNoVarsReq extends GHeroNoVarsReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -220,7 +225,8 @@ class _$GHeroNoVarsReq extends GHeroNoVarsReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -280,6 +286,10 @@ class GHeroNoVarsReqBuilder set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GHeroNoVarsReqBuilder() { GHeroNoVarsReq._initializeBuilder(this); } @@ -296,6 +306,7 @@ class GHeroNoVarsReqBuilder _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -330,7 +341,8 @@ class GHeroNoVarsReqBuilder updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, r'GHeroNoVarsReq', 'executeOnListen')); + executeOnListen, r'GHeroNoVarsReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.var.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.var.gql.dart index 29286a52..b8fb296a 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_no_vars.var.gql.dart @@ -13,7 +13,7 @@ abstract class GHeroNoVarsVars implements Built { GHeroNoVarsVars._(); - factory GHeroNoVarsVars([Function(GHeroNoVarsVarsBuilder b) updates]) = + factory GHeroNoVarsVars([void Function(GHeroNoVarsVarsBuilder b) updates]) = _$GHeroNoVarsVars; static Serializer get serializer => diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.data.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.data.gql.dart index 0bdf1e1f..92f0076a 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.data.gql.dart @@ -15,7 +15,7 @@ abstract class GHeroWithFragmentsData GHeroWithFragmentsData._(); factory GHeroWithFragmentsData( - [Function(GHeroWithFragmentsDataBuilder b) updates]) = + [void Function(GHeroWithFragmentsDataBuilder b) updates]) = _$GHeroWithFragmentsData; static void _initializeBuilder(GHeroWithFragmentsDataBuilder b) => @@ -46,7 +46,7 @@ abstract class GHeroWithFragmentsData_hero GHeroWithFragmentsData_hero._(); factory GHeroWithFragmentsData_hero( - [Function(GHeroWithFragmentsData_heroBuilder b) updates]) = + [void Function(GHeroWithFragmentsData_heroBuilder b) updates]) = _$GHeroWithFragmentsData_hero; static void _initializeBuilder(GHeroWithFragmentsData_heroBuilder b) => @@ -85,7 +85,7 @@ abstract class GHeroWithFragmentsData_hero_friendsConnection GHeroWithFragmentsData_hero_friendsConnection._(); factory GHeroWithFragmentsData_hero_friendsConnection( - [Function(GHeroWithFragmentsData_hero_friendsConnectionBuilder b) + [void Function(GHeroWithFragmentsData_hero_friendsConnectionBuilder b) updates]) = _$GHeroWithFragmentsData_hero_friendsConnection; static void _initializeBuilder( @@ -124,7 +124,8 @@ abstract class GHeroWithFragmentsData_hero_friendsConnection_edges GHeroWithFragmentsData_hero_friendsConnection_edges._(); factory GHeroWithFragmentsData_hero_friendsConnection_edges( - [Function(GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder b) + [void Function( + GHeroWithFragmentsData_hero_friendsConnection_edgesBuilder b) updates]) = _$GHeroWithFragmentsData_hero_friendsConnection_edges; static void _initializeBuilder( @@ -165,7 +166,7 @@ abstract class GheroDataData implements Built, GheroData { GheroDataData._(); - factory GheroDataData([Function(GheroDataDataBuilder b) updates]) = + factory GheroDataData([void Function(GheroDataDataBuilder b) updates]) = _$GheroDataData; static void _initializeBuilder(GheroDataDataBuilder b) => @@ -226,7 +227,7 @@ abstract class GcomparisonFieldsData GcomparisonFieldsData._(); factory GcomparisonFieldsData( - [Function(GcomparisonFieldsDataBuilder b) updates]) = + [void Function(GcomparisonFieldsDataBuilder b) updates]) = _$GcomparisonFieldsData; static void _initializeBuilder(GcomparisonFieldsDataBuilder b) => @@ -265,7 +266,7 @@ abstract class GcomparisonFieldsData_friendsConnection GcomparisonFieldsData_friendsConnection._(); factory GcomparisonFieldsData_friendsConnection( - [Function(GcomparisonFieldsData_friendsConnectionBuilder b) + [void Function(GcomparisonFieldsData_friendsConnectionBuilder b) updates]) = _$GcomparisonFieldsData_friendsConnection; static void _initializeBuilder( @@ -304,7 +305,7 @@ abstract class GcomparisonFieldsData_friendsConnection_edges GcomparisonFieldsData_friendsConnection_edges._(); factory GcomparisonFieldsData_friendsConnection_edges( - [Function(GcomparisonFieldsData_friendsConnection_edgesBuilder b) + [void Function(GcomparisonFieldsData_friendsConnection_edgesBuilder b) updates]) = _$GcomparisonFieldsData_friendsConnection_edges; static void _initializeBuilder( diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.req.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.req.gql.dart index cd82d276..1f6313ee 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.req.gql.dart @@ -26,7 +26,7 @@ abstract class GHeroWithFragmentsReq GHeroWithFragmentsReq._(); factory GHeroWithFragmentsReq( - [Function(GHeroWithFragmentsReqBuilder b) updates]) = + [void Function(GHeroWithFragmentsReqBuilder b) updates]) = _$GHeroWithFragmentsReq; static void _initializeBuilder(GHeroWithFragmentsReqBuilder b) => b @@ -44,6 +44,7 @@ abstract class GHeroWithFragmentsReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -65,6 +66,9 @@ abstract class GHeroWithFragmentsReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GHeroWithFragmentsData? parseData(Map json) => _i2.GHeroWithFragmentsData.fromJson(json); @@ -101,7 +105,7 @@ abstract class GheroDataReq _i1.FragmentRequest<_i2.GheroDataData, _i3.GheroDataVars> { GheroDataReq._(); - factory GheroDataReq([Function(GheroDataReqBuilder b) updates]) = + factory GheroDataReq([void Function(GheroDataReqBuilder b) updates]) = _$GheroDataReq; static void _initializeBuilder(GheroDataReqBuilder b) => b @@ -148,7 +152,7 @@ abstract class GcomparisonFieldsReq GcomparisonFieldsReq._(); factory GcomparisonFieldsReq( - [Function(GcomparisonFieldsReqBuilder b) updates]) = + [void Function(GcomparisonFieldsReqBuilder b) updates]) = _$GcomparisonFieldsReq; static void _initializeBuilder(GcomparisonFieldsReqBuilder b) => b diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.req.gql.g.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.req.gql.g.dart index e25f829e..ca14e7e6 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.req.gql.g.dart @@ -304,6 +304,8 @@ class _$GHeroWithFragmentsReq extends GHeroWithFragmentsReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GHeroWithFragmentsReq( [void Function(GHeroWithFragmentsReqBuilder)? updates]) => @@ -318,7 +320,8 @@ class _$GHeroWithFragmentsReq extends GHeroWithFragmentsReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull( vars, r'GHeroWithFragmentsReq', 'vars'); @@ -350,7 +353,8 @@ class _$GHeroWithFragmentsReq extends GHeroWithFragmentsReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -365,6 +369,7 @@ class _$GHeroWithFragmentsReq extends GHeroWithFragmentsReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -380,7 +385,8 @@ class _$GHeroWithFragmentsReq extends GHeroWithFragmentsReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -442,6 +448,10 @@ class GHeroWithFragmentsReqBuilder set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GHeroWithFragmentsReqBuilder() { GHeroWithFragmentsReq._initializeBuilder(this); } @@ -458,6 +468,7 @@ class GHeroWithFragmentsReqBuilder _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -492,9 +503,8 @@ class GHeroWithFragmentsReqBuilder updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, - r'GHeroWithFragmentsReq', - 'executeOnListen')); + executeOnListen, r'GHeroWithFragmentsReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.var.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.var.gql.dart index 503a0905..6fa5049b 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_fragments.var.gql.dart @@ -16,7 +16,7 @@ abstract class GHeroWithFragmentsVars GHeroWithFragmentsVars._(); factory GHeroWithFragmentsVars( - [Function(GHeroWithFragmentsVarsBuilder b) updates]) = + [void Function(GHeroWithFragmentsVarsBuilder b) updates]) = _$GHeroWithFragmentsVars; _i1.GEpisode? get episode; @@ -39,7 +39,7 @@ abstract class GheroDataVars implements Built { GheroDataVars._(); - factory GheroDataVars([Function(GheroDataVarsBuilder b) updates]) = + factory GheroDataVars([void Function(GheroDataVarsBuilder b) updates]) = _$GheroDataVars; static Serializer get serializer => _$gheroDataVarsSerializer; @@ -61,7 +61,7 @@ abstract class GcomparisonFieldsVars GcomparisonFieldsVars._(); factory GcomparisonFieldsVars( - [Function(GcomparisonFieldsVarsBuilder b) updates]) = + [void Function(GcomparisonFieldsVarsBuilder b) updates]) = _$GcomparisonFieldsVars; int? get first; diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.data.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.data.gql.dart index cd9c48d1..18634ea6 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.data.gql.dart @@ -16,7 +16,8 @@ abstract class GHeroForEpisodeData GHeroForEpisodeData._(); factory GHeroForEpisodeData( - [Function(GHeroForEpisodeDataBuilder b) updates]) = _$GHeroForEpisodeData; + [void Function(GHeroForEpisodeDataBuilder b) updates]) = + _$GHeroForEpisodeData; static void _initializeBuilder(GHeroForEpisodeDataBuilder b) => b..G__typename = 'Query'; @@ -70,7 +71,7 @@ abstract class GHeroForEpisodeData_hero__base GHeroForEpisodeData_hero__base._(); factory GHeroForEpisodeData_hero__base( - [Function(GHeroForEpisodeData_hero__baseBuilder b) updates]) = + [void Function(GHeroForEpisodeData_hero__baseBuilder b) updates]) = _$GHeroForEpisodeData_hero__base; static void _initializeBuilder(GHeroForEpisodeData_hero__baseBuilder b) => @@ -106,7 +107,7 @@ abstract class GHeroForEpisodeData_hero__asDroid GHeroForEpisodeData_hero__asDroid._(); factory GHeroForEpisodeData_hero__asDroid( - [Function(GHeroForEpisodeData_hero__asDroidBuilder b) updates]) = + [void Function(GHeroForEpisodeData_hero__asDroidBuilder b) updates]) = _$GHeroForEpisodeData_hero__asDroid; static void _initializeBuilder(GHeroForEpisodeData_hero__asDroidBuilder b) => @@ -148,7 +149,8 @@ abstract class GDroidFragmentData GDroidFragment { GDroidFragmentData._(); - factory GDroidFragmentData([Function(GDroidFragmentDataBuilder b) updates]) = + factory GDroidFragmentData( + [void Function(GDroidFragmentDataBuilder b) updates]) = _$GDroidFragmentData; static void _initializeBuilder(GDroidFragmentDataBuilder b) => diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.req.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.req.gql.dart index 3d53f336..e230548f 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.req.gql.dart @@ -24,7 +24,8 @@ abstract class GHeroForEpisodeReq _i1.OperationRequest<_i2.GHeroForEpisodeData, _i3.GHeroForEpisodeVars> { GHeroForEpisodeReq._(); - factory GHeroForEpisodeReq([Function(GHeroForEpisodeReqBuilder b) updates]) = + factory GHeroForEpisodeReq( + [void Function(GHeroForEpisodeReqBuilder b) updates]) = _$GHeroForEpisodeReq; static void _initializeBuilder(GHeroForEpisodeReqBuilder b) => b @@ -42,6 +43,7 @@ abstract class GHeroForEpisodeReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -63,6 +65,9 @@ abstract class GHeroForEpisodeReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GHeroForEpisodeData? parseData(Map json) => _i2.GHeroForEpisodeData.fromJson(json); @@ -99,7 +104,8 @@ abstract class GDroidFragmentReq _i1.FragmentRequest<_i2.GDroidFragmentData, _i3.GDroidFragmentVars> { GDroidFragmentReq._(); - factory GDroidFragmentReq([Function(GDroidFragmentReqBuilder b) updates]) = + factory GDroidFragmentReq( + [void Function(GDroidFragmentReqBuilder b) updates]) = _$GDroidFragmentReq; static void _initializeBuilder(GDroidFragmentReqBuilder b) => b diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.req.gql.g.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.req.gql.g.dart index 05f8d901..434305b4 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.req.gql.g.dart @@ -223,6 +223,8 @@ class _$GHeroForEpisodeReq extends GHeroForEpisodeReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GHeroForEpisodeReq( [void Function(GHeroForEpisodeReqBuilder)? updates]) => @@ -237,7 +239,8 @@ class _$GHeroForEpisodeReq extends GHeroForEpisodeReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull(vars, r'GHeroForEpisodeReq', 'vars'); BuiltValueNullFieldError.checkNotNull( @@ -268,7 +271,8 @@ class _$GHeroForEpisodeReq extends GHeroForEpisodeReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -283,6 +287,7 @@ class _$GHeroForEpisodeReq extends GHeroForEpisodeReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -298,7 +303,8 @@ class _$GHeroForEpisodeReq extends GHeroForEpisodeReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -359,6 +365,10 @@ class GHeroForEpisodeReqBuilder set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GHeroForEpisodeReqBuilder() { GHeroForEpisodeReq._initializeBuilder(this); } @@ -375,6 +385,7 @@ class GHeroForEpisodeReqBuilder _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -409,7 +420,8 @@ class GHeroForEpisodeReqBuilder updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, r'GHeroForEpisodeReq', 'executeOnListen')); + executeOnListen, r'GHeroForEpisodeReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.var.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.var.gql.dart index 2bf3bec3..812714b1 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/hero_with_inline_fragment.var.gql.dart @@ -16,7 +16,8 @@ abstract class GHeroForEpisodeVars GHeroForEpisodeVars._(); factory GHeroForEpisodeVars( - [Function(GHeroForEpisodeVarsBuilder b) updates]) = _$GHeroForEpisodeVars; + [void Function(GHeroForEpisodeVarsBuilder b) updates]) = + _$GHeroForEpisodeVars; _i1.GEpisode get ep; static Serializer get serializer => @@ -38,7 +39,8 @@ abstract class GDroidFragmentVars implements Built { GDroidFragmentVars._(); - factory GDroidFragmentVars([Function(GDroidFragmentVarsBuilder b) updates]) = + factory GDroidFragmentVars( + [void Function(GDroidFragmentVarsBuilder b) updates]) = _$GDroidFragmentVars; static Serializer get serializer => diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.ast.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.ast.gql.dart index 9e0f3f14..96ca6591 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.ast.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.ast.gql.dart @@ -2,6 +2,8 @@ // ignore_for_file: type=lint // ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.ast.gql.dart' + as _i2; import 'package:gql/ast.dart' as _i1; const HumanWithArgs = _i1.OperationDefinitionNode( @@ -40,69 +42,15 @@ const HumanWithArgs = _i1.OperationDefinitionNode( ], directives: [], selectionSet: _i1.SelectionSetNode(selections: [ - _i1.FieldNode( - name: _i1.NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - _i1.FieldNode( - name: _i1.NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - _i1.FieldNode( - name: _i1.NameNode(value: 'height'), - alias: null, - arguments: [], + _i1.FragmentSpreadNode( + name: _i1.NameNode(value: 'HumanFragment'), directives: [], - selectionSet: null, - ), - _i1.FieldNode( - name: _i1.NameNode(value: 'friendsConnection'), - alias: null, - arguments: [ - _i1.ArgumentNode( - name: _i1.NameNode(value: 'first'), - value: _i1.IntValueNode(value: '10'), - ), - _i1.ArgumentNode( - name: _i1.NameNode(value: 'after'), - value: - _i1.VariableNode(name: _i1.NameNode(value: 'friendsAfter')), - ), - ], - directives: [], - selectionSet: _i1.SelectionSetNode(selections: [ - _i1.FieldNode( - name: _i1.NameNode(value: 'friends'), - alias: null, - arguments: [], - directives: [], - selectionSet: _i1.SelectionSetNode(selections: [ - _i1.FieldNode( - name: _i1.NameNode(value: 'id'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - _i1.FieldNode( - name: _i1.NameNode(value: 'name'), - alias: null, - arguments: [], - directives: [], - selectionSet: null, - ), - ]), - ) - ]), - ), + ) ]), ) ]), ); -const document = _i1.DocumentNode(definitions: [HumanWithArgs]); +const document = _i1.DocumentNode(definitions: [ + HumanWithArgs, + _i2.HumanFragment, +]); diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.data.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.data.gql.dart index 02cc5a70..b422ef9f 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.data.gql.dart @@ -5,6 +5,8 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.data.gql.dart' + as _i2; import 'package:ferry_test_graphql2/schema/__generated__/serializers.gql.dart' as _i1; @@ -14,7 +16,8 @@ abstract class GHumanWithArgsData implements Built { GHumanWithArgsData._(); - factory GHumanWithArgsData([Function(GHumanWithArgsDataBuilder b) updates]) = + factory GHumanWithArgsData( + [void Function(GHumanWithArgsDataBuilder b) updates]) = _$GHumanWithArgsData; static void _initializeBuilder(GHumanWithArgsDataBuilder b) => @@ -40,25 +43,32 @@ abstract class GHumanWithArgsData abstract class GHumanWithArgsData_human implements - Built { + Built, + _i2.GHumanFragment { GHumanWithArgsData_human._(); factory GHumanWithArgsData_human( - [Function(GHumanWithArgsData_humanBuilder b) updates]) = + [void Function(GHumanWithArgsData_humanBuilder b) updates]) = _$GHumanWithArgsData_human; static void _initializeBuilder(GHumanWithArgsData_humanBuilder b) => b..G__typename = 'Human'; + @override @BuiltValueField(wireName: '__typename') String get G__typename; + @override String get id; + @override String get name; + @override double? get height; + @override GHumanWithArgsData_human_friendsConnection get friendsConnection; static Serializer get serializer => _$gHumanWithArgsDataHumanSerializer; + @override Map toJson() => (_i1.serializers.serializeWith( GHumanWithArgsData_human.serializer, this, @@ -74,23 +84,27 @@ abstract class GHumanWithArgsData_human abstract class GHumanWithArgsData_human_friendsConnection implements Built { + GHumanWithArgsData_human_friendsConnectionBuilder>, + _i2.GHumanFragment_friendsConnection { GHumanWithArgsData_human_friendsConnection._(); factory GHumanWithArgsData_human_friendsConnection( - [Function(GHumanWithArgsData_human_friendsConnectionBuilder b) + [void Function(GHumanWithArgsData_human_friendsConnectionBuilder b) updates]) = _$GHumanWithArgsData_human_friendsConnection; static void _initializeBuilder( GHumanWithArgsData_human_friendsConnectionBuilder b) => b..G__typename = 'FriendsConnection'; + @override @BuiltValueField(wireName: '__typename') String get G__typename; + @override BuiltList? get friends; static Serializer get serializer => _$gHumanWithArgsDataHumanFriendsConnectionSerializer; + @override Map toJson() => (_i1.serializers.serializeWith( GHumanWithArgsData_human_friendsConnection.serializer, this, @@ -107,25 +121,31 @@ abstract class GHumanWithArgsData_human_friendsConnection abstract class GHumanWithArgsData_human_friendsConnection_friends implements Built { + GHumanWithArgsData_human_friendsConnection_friendsBuilder>, + _i2.GHumanFragment_friendsConnection_friends { GHumanWithArgsData_human_friendsConnection_friends._(); factory GHumanWithArgsData_human_friendsConnection_friends( - [Function(GHumanWithArgsData_human_friendsConnection_friendsBuilder b) + [void Function( + GHumanWithArgsData_human_friendsConnection_friendsBuilder b) updates]) = _$GHumanWithArgsData_human_friendsConnection_friends; static void _initializeBuilder( GHumanWithArgsData_human_friendsConnection_friendsBuilder b) => b..G__typename = 'Character'; + @override @BuiltValueField(wireName: '__typename') String get G__typename; + @override String get id; + @override String get name; static Serializer get serializer => _$gHumanWithArgsDataHumanFriendsConnectionFriendsSerializer; + @override Map toJson() => (_i1.serializers.serializeWith( GHumanWithArgsData_human_friendsConnection_friends.serializer, this, diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.req.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.req.gql.dart index 264dd6cd..14a17ca3 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.req.gql.dart @@ -23,7 +23,8 @@ abstract class GHumanWithArgsReq _i1.OperationRequest<_i2.GHumanWithArgsData, _i3.GHumanWithArgsVars> { GHumanWithArgsReq._(); - factory GHumanWithArgsReq([Function(GHumanWithArgsReqBuilder b) updates]) = + factory GHumanWithArgsReq( + [void Function(GHumanWithArgsReqBuilder b) updates]) = _$GHumanWithArgsReq; static void _initializeBuilder(GHumanWithArgsReqBuilder b) => b @@ -41,6 +42,7 @@ abstract class GHumanWithArgsReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -62,6 +64,9 @@ abstract class GHumanWithArgsReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GHumanWithArgsData? parseData(Map json) => _i2.GHumanWithArgsData.fromJson(json); diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.req.gql.g.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.req.gql.g.dart index 785fb24f..b9d8a560 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.req.gql.g.dart @@ -147,6 +147,8 @@ class _$GHumanWithArgsReq extends GHumanWithArgsReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GHumanWithArgsReq( [void Function(GHumanWithArgsReqBuilder)? updates]) => @@ -161,7 +163,8 @@ class _$GHumanWithArgsReq extends GHumanWithArgsReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull(vars, r'GHumanWithArgsReq', 'vars'); BuiltValueNullFieldError.checkNotNull( @@ -191,7 +194,8 @@ class _$GHumanWithArgsReq extends GHumanWithArgsReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -206,6 +210,7 @@ class _$GHumanWithArgsReq extends GHumanWithArgsReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -221,7 +226,8 @@ class _$GHumanWithArgsReq extends GHumanWithArgsReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -282,6 +288,10 @@ class GHumanWithArgsReqBuilder set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GHumanWithArgsReqBuilder() { GHumanWithArgsReq._initializeBuilder(this); } @@ -298,6 +308,7 @@ class GHumanWithArgsReqBuilder _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -332,7 +343,8 @@ class GHumanWithArgsReqBuilder updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, r'GHumanWithArgsReq', 'executeOnListen')); + executeOnListen, r'GHumanWithArgsReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.var.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.var.gql.dart index 49540057..931034ab 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/human_with_args.var.gql.dart @@ -13,7 +13,8 @@ abstract class GHumanWithArgsVars implements Built { GHumanWithArgsVars._(); - factory GHumanWithArgsVars([Function(GHumanWithArgsVarsBuilder b) updates]) = + factory GHumanWithArgsVars( + [void Function(GHumanWithArgsVarsBuilder b) updates]) = _$GHumanWithArgsVars; String get id; diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.data.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.data.gql.dart index 67efe81d..ae9da921 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.data.gql.dart @@ -16,7 +16,7 @@ abstract class GReviewsByIDData implements Built { GReviewsByIDData._(); - factory GReviewsByIDData([Function(GReviewsByIDDataBuilder b) updates]) = + factory GReviewsByIDData([void Function(GReviewsByIDDataBuilder b) updates]) = _$GReviewsByIDData; static void _initializeBuilder(GReviewsByIDDataBuilder b) => @@ -45,7 +45,7 @@ abstract class GReviewsByIDData_review GReviewsByIDData_review._(); factory GReviewsByIDData_review( - [Function(GReviewsByIDData_reviewBuilder b) updates]) = + [void Function(GReviewsByIDData_reviewBuilder b) updates]) = _$GReviewsByIDData_review; static void _initializeBuilder(GReviewsByIDData_reviewBuilder b) => diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.req.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.req.gql.dart index 2fde06ad..a6b80889 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.req.gql.dart @@ -23,7 +23,7 @@ abstract class GReviewsByIDReq _i1.OperationRequest<_i2.GReviewsByIDData, _i3.GReviewsByIDVars> { GReviewsByIDReq._(); - factory GReviewsByIDReq([Function(GReviewsByIDReqBuilder b) updates]) = + factory GReviewsByIDReq([void Function(GReviewsByIDReqBuilder b) updates]) = _$GReviewsByIDReq; static void _initializeBuilder(GReviewsByIDReqBuilder b) => b @@ -41,6 +41,7 @@ abstract class GReviewsByIDReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -62,6 +63,9 @@ abstract class GReviewsByIDReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GReviewsByIDData? parseData(Map json) => _i2.GReviewsByIDData.fromJson(json); diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.req.gql.g.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.req.gql.g.dart index ef41087a..576b7a76 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.req.gql.g.dart @@ -147,6 +147,8 @@ class _$GReviewsByIDReq extends GReviewsByIDReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GReviewsByIDReq([void Function(GReviewsByIDReqBuilder)? updates]) => (new GReviewsByIDReqBuilder()..update(updates))._build(); @@ -160,7 +162,8 @@ class _$GReviewsByIDReq extends GReviewsByIDReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull(vars, r'GReviewsByIDReq', 'vars'); BuiltValueNullFieldError.checkNotNull( @@ -190,7 +193,8 @@ class _$GReviewsByIDReq extends GReviewsByIDReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -205,6 +209,7 @@ class _$GReviewsByIDReq extends GReviewsByIDReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -220,7 +225,8 @@ class _$GReviewsByIDReq extends GReviewsByIDReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -280,6 +286,10 @@ class GReviewsByIDReqBuilder set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GReviewsByIDReqBuilder() { GReviewsByIDReq._initializeBuilder(this); } @@ -296,6 +306,7 @@ class GReviewsByIDReqBuilder _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -330,7 +341,8 @@ class GReviewsByIDReqBuilder updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, r'GReviewsByIDReq', 'executeOnListen')); + executeOnListen, r'GReviewsByIDReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.var.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.var.gql.dart index 9c792894..eab34dc0 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/review_by_id.var.gql.dart @@ -13,7 +13,7 @@ abstract class GReviewsByIDVars implements Built { GReviewsByIDVars._(); - factory GReviewsByIDVars([Function(GReviewsByIDVarsBuilder b) updates]) = + factory GReviewsByIDVars([void Function(GReviewsByIDVarsBuilder b) updates]) = _$GReviewsByIDVars; String get id; diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.data.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.data.gql.dart index 36923b94..c5eef767 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.data.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.data.gql.dart @@ -16,7 +16,7 @@ abstract class GReviewsData implements Built { GReviewsData._(); - factory GReviewsData([Function(GReviewsDataBuilder b) updates]) = + factory GReviewsData([void Function(GReviewsDataBuilder b) updates]) = _$GReviewsData; static void _initializeBuilder(GReviewsDataBuilder b) => @@ -44,7 +44,7 @@ abstract class GReviewsData_reviews GReviewsData_reviews._(); factory GReviewsData_reviews( - [Function(GReviewsData_reviewsBuilder b) updates]) = + [void Function(GReviewsData_reviewsBuilder b) updates]) = _$GReviewsData_reviews; static void _initializeBuilder(GReviewsData_reviewsBuilder b) => diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.req.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.req.gql.dart index 390118a3..f8e359c5 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.req.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.req.gql.dart @@ -23,7 +23,8 @@ abstract class GReviewsReq _i1.OperationRequest<_i2.GReviewsData, _i3.GReviewsVars> { GReviewsReq._(); - factory GReviewsReq([Function(GReviewsReqBuilder b) updates]) = _$GReviewsReq; + factory GReviewsReq([void Function(GReviewsReqBuilder b) updates]) = + _$GReviewsReq; static void _initializeBuilder(GReviewsReqBuilder b) => b ..operation = _i4.Operation( @@ -40,6 +41,7 @@ abstract class GReviewsReq _i4.Request get execRequest => _i4.Request( operation: operation, variables: vars.toJson(), + context: context ?? const _i4.Context(), ); @override @@ -61,6 +63,9 @@ abstract class GReviewsReq @override bool get executeOnListen; @override + @BuiltValueField(serialize: false) + _i4.Context? get context; + @override _i2.GReviewsData? parseData(Map json) => _i2.GReviewsData.fromJson(json); diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.req.gql.g.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.req.gql.g.dart index f3b54720..257d7919 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.req.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.req.gql.g.dart @@ -144,6 +144,8 @@ class _$GReviewsReq extends GReviewsReq { final _i1.FetchPolicy? fetchPolicy; @override final bool executeOnListen; + @override + final _i4.Context? context; factory _$GReviewsReq([void Function(GReviewsReqBuilder)? updates]) => (new GReviewsReqBuilder()..update(updates))._build(); @@ -157,7 +159,8 @@ class _$GReviewsReq extends GReviewsReq { this.updateCacheHandlerKey, this.updateCacheHandlerContext, this.fetchPolicy, - required this.executeOnListen}) + required this.executeOnListen, + this.context}) : super._() { BuiltValueNullFieldError.checkNotNull(vars, r'GReviewsReq', 'vars'); BuiltValueNullFieldError.checkNotNull( @@ -186,7 +189,8 @@ class _$GReviewsReq extends GReviewsReq { updateCacheHandlerKey == other.updateCacheHandlerKey && updateCacheHandlerContext == other.updateCacheHandlerContext && fetchPolicy == other.fetchPolicy && - executeOnListen == other.executeOnListen; + executeOnListen == other.executeOnListen && + context == other.context; } @override @@ -201,6 +205,7 @@ class _$GReviewsReq extends GReviewsReq { _$hash = $jc(_$hash, updateCacheHandlerContext.hashCode); _$hash = $jc(_$hash, fetchPolicy.hashCode); _$hash = $jc(_$hash, executeOnListen.hashCode); + _$hash = $jc(_$hash, context.hashCode); _$hash = $jf(_$hash); return _$hash; } @@ -216,7 +221,8 @@ class _$GReviewsReq extends GReviewsReq { ..add('updateCacheHandlerKey', updateCacheHandlerKey) ..add('updateCacheHandlerContext', updateCacheHandlerContext) ..add('fetchPolicy', fetchPolicy) - ..add('executeOnListen', executeOnListen)) + ..add('executeOnListen', executeOnListen) + ..add('context', context)) .toString(); } } @@ -274,6 +280,10 @@ class GReviewsReqBuilder implements Builder { set executeOnListen(bool? executeOnListen) => _$this._executeOnListen = executeOnListen; + _i4.Context? _context; + _i4.Context? get context => _$this._context; + set context(_i4.Context? context) => _$this._context = context; + GReviewsReqBuilder() { GReviewsReq._initializeBuilder(this); } @@ -290,6 +300,7 @@ class GReviewsReqBuilder implements Builder { _updateCacheHandlerContext = $v.updateCacheHandlerContext; _fetchPolicy = $v.fetchPolicy; _executeOnListen = $v.executeOnListen; + _context = $v.context; _$v = null; } return this; @@ -324,7 +335,8 @@ class GReviewsReqBuilder implements Builder { updateCacheHandlerContext: updateCacheHandlerContext, fetchPolicy: fetchPolicy, executeOnListen: BuiltValueNullFieldError.checkNotNull( - executeOnListen, r'GReviewsReq', 'executeOnListen')); + executeOnListen, r'GReviewsReq', 'executeOnListen'), + context: context); } catch (_) { late String _$failedField; try { diff --git a/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.var.gql.dart b/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.var.gql.dart index ac220c90..0f0fdaf5 100644 --- a/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.var.gql.dart +++ b/packages/ferry_test_graphql2/lib/queries/__generated__/reviews.var.gql.dart @@ -15,7 +15,7 @@ abstract class GReviewsVars implements Built { GReviewsVars._(); - factory GReviewsVars([Function(GReviewsVarsBuilder b) updates]) = + factory GReviewsVars([void Function(GReviewsVarsBuilder b) updates]) = _$GReviewsVars; _i1.GEpisode? get episode; diff --git a/packages/ferry_test_graphql2/lib/queries/human_with_args.graphql b/packages/ferry_test_graphql2/lib/queries/human_with_args.graphql index 39a47f29..900f8227 100644 --- a/packages/ferry_test_graphql2/lib/queries/human_with_args.graphql +++ b/packages/ferry_test_graphql2/lib/queries/human_with_args.graphql @@ -1,13 +1,7 @@ +# import '../fragments/human_fragment.graphql' + query HumanWithArgs($id: ID!, $friendsAfter: ID) { human(id: $id) { - id - name - height - friendsConnection(first: 10, after: $friendsAfter) { - friends { - id - name - } - } + ...HumanFragment } } diff --git a/packages/ferry_test_graphql2/lib/schema/__generated__/schema.schema.gql.dart b/packages/ferry_test_graphql2/lib/schema/__generated__/schema.schema.gql.dart index af70aa1a..fc380255 100644 --- a/packages/ferry_test_graphql2/lib/schema/__generated__/schema.schema.gql.dart +++ b/packages/ferry_test_graphql2/lib/schema/__generated__/schema.schema.gql.dart @@ -46,7 +46,7 @@ abstract class GReviewInput implements Built { GReviewInput._(); - factory GReviewInput([Function(GReviewInputBuilder b) updates]) = + factory GReviewInput([void Function(GReviewInputBuilder b) updates]) = _$GReviewInput; int get stars; @@ -70,7 +70,8 @@ abstract class GReviewInput abstract class GColorInput implements Built { GColorInput._(); - factory GColorInput([Function(GColorInputBuilder b) updates]) = _$GColorInput; + factory GColorInput([void Function(GColorInputBuilder b) updates]) = + _$GColorInput; int get red; int get green; diff --git a/packages/ferry_test_graphql2/lib/schema/__generated__/serializers.gql.dart b/packages/ferry_test_graphql2/lib/schema/__generated__/serializers.gql.dart index d7866c9e..165a9f44 100644 --- a/packages/ferry_test_graphql2/lib/schema/__generated__/serializers.gql.dart +++ b/packages/ferry_test_graphql2/lib/schema/__generated__/serializers.gql.dart @@ -6,6 +6,15 @@ import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart' show StandardJsonPlugin; import 'package:ferry_exec/ferry_exec.dart'; import 'package:ferry_test_graphql2/date_serializer.dart' show DateSerializer; +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.data.gql.dart' + show + GHumanFragmentData, + GHumanFragmentData_friendsConnection, + GHumanFragmentData_friendsConnection_friends; +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.req.gql.dart' + show GHumanFragmentReq; +import 'package:ferry_test_graphql2/fragments/__generated__/human_fragment.var.gql.dart' + show GHumanFragmentVars; import 'package:ferry_test_graphql2/fragments/__generated__/review_fragment.data.gql.dart' show GReviewFragmentData; import 'package:ferry_test_graphql2/fragments/__generated__/review_fragment.req.gql.dart' @@ -128,6 +137,11 @@ final SerializersBuilder _serializersBuilder = _$serializers.toBuilder() GHeroWithFragmentsData_hero_friendsConnection_edges, GHeroWithFragmentsReq, GHeroWithFragmentsVars, + GHumanFragmentData, + GHumanFragmentData_friendsConnection, + GHumanFragmentData_friendsConnection_friends, + GHumanFragmentReq, + GHumanFragmentVars, GHumanWithArgsData, GHumanWithArgsData_human, GHumanWithArgsData_human_friendsConnection, diff --git a/packages/ferry_test_graphql2/lib/schema/__generated__/serializers.gql.g.dart b/packages/ferry_test_graphql2/lib/schema/__generated__/serializers.gql.g.dart index 50215352..e80446b9 100644 --- a/packages/ferry_test_graphql2/lib/schema/__generated__/serializers.gql.g.dart +++ b/packages/ferry_test_graphql2/lib/schema/__generated__/serializers.gql.g.dart @@ -37,6 +37,11 @@ Serializers _$serializers = (new Serializers().toBuilder() ..add(GHeroWithFragmentsData_hero_friendsConnection_edges.serializer) ..add(GHeroWithFragmentsReq.serializer) ..add(GHeroWithFragmentsVars.serializer) + ..add(GHumanFragmentData.serializer) + ..add(GHumanFragmentData_friendsConnection.serializer) + ..add(GHumanFragmentData_friendsConnection_friends.serializer) + ..add(GHumanFragmentReq.serializer) + ..add(GHumanFragmentVars.serializer) ..add(GHumanWithArgsData.serializer) ..add(GHumanWithArgsData_human.serializer) ..add(GHumanWithArgsData_human_friendsConnection.serializer) @@ -94,6 +99,13 @@ Serializers _$serializers = (new Serializers().toBuilder() ]), () => new ListBuilder< GHeroWithFragmentsData_hero_friendsConnection_edges?>()) + ..addBuilderFactory( + const FullType(BuiltList, const [ + const FullType.nullable( + GHumanFragmentData_friendsConnection_friends) + ]), + () => + new ListBuilder()) ..addBuilderFactory( const FullType(BuiltList, const [ const FullType.nullable(