|
| 1 | +import 'dart:async'; |
| 2 | +import 'package:gql/ast.dart'; |
| 3 | +import 'package:graphql/client.dart' as graphql; |
| 4 | + |
| 5 | +class Mutation$M { |
| 6 | + Mutation$M({ |
| 7 | + this.bar, |
| 8 | + this.$__typename = 'Mutation', |
| 9 | + }); |
| 10 | + |
| 11 | + factory Mutation$M.fromJson(Map<String, dynamic> json) { |
| 12 | + final l$bar = json['bar']; |
| 13 | + final l$$__typename = json['__typename']; |
| 14 | + return Mutation$M( |
| 15 | + bar: (l$bar as String?), |
| 16 | + $__typename: (l$$__typename as String), |
| 17 | + ); |
| 18 | + } |
| 19 | + |
| 20 | + final String? bar; |
| 21 | + |
| 22 | + final String $__typename; |
| 23 | + |
| 24 | + Map<String, dynamic> toJson() { |
| 25 | + final _resultData = <String, dynamic>{}; |
| 26 | + final l$bar = bar; |
| 27 | + _resultData['bar'] = l$bar; |
| 28 | + final l$$__typename = $__typename; |
| 29 | + _resultData['__typename'] = l$$__typename; |
| 30 | + return _resultData; |
| 31 | + } |
| 32 | + |
| 33 | + @override |
| 34 | + int get hashCode { |
| 35 | + final l$bar = bar; |
| 36 | + final l$$__typename = $__typename; |
| 37 | + return Object.hashAll([ |
| 38 | + l$bar, |
| 39 | + l$$__typename, |
| 40 | + ]); |
| 41 | + } |
| 42 | + |
| 43 | + @override |
| 44 | + bool operator ==(Object other) { |
| 45 | + if (identical(this, other)) { |
| 46 | + return true; |
| 47 | + } |
| 48 | + if (other is! Mutation$M || runtimeType != other.runtimeType) { |
| 49 | + return false; |
| 50 | + } |
| 51 | + final l$bar = bar; |
| 52 | + final lOther$bar = other.bar; |
| 53 | + if (l$bar != lOther$bar) { |
| 54 | + return false; |
| 55 | + } |
| 56 | + final l$$__typename = $__typename; |
| 57 | + final lOther$$__typename = other.$__typename; |
| 58 | + if (l$$__typename != lOther$$__typename) { |
| 59 | + return false; |
| 60 | + } |
| 61 | + return true; |
| 62 | + } |
| 63 | +} |
| 64 | + |
| 65 | +extension UtilityExtension$Mutation$M on Mutation$M { |
| 66 | + CopyWith$Mutation$M<Mutation$M> get copyWith => CopyWith$Mutation$M( |
| 67 | + this, |
| 68 | + (i) => i, |
| 69 | + ); |
| 70 | +} |
| 71 | + |
| 72 | +abstract class CopyWith$Mutation$M<TRes> { |
| 73 | + factory CopyWith$Mutation$M( |
| 74 | + Mutation$M instance, |
| 75 | + TRes Function(Mutation$M) then, |
| 76 | + ) = _CopyWithImpl$Mutation$M; |
| 77 | + |
| 78 | + factory CopyWith$Mutation$M.stub(TRes res) = _CopyWithStubImpl$Mutation$M; |
| 79 | + |
| 80 | + TRes call({ |
| 81 | + String? bar, |
| 82 | + String? $__typename, |
| 83 | + }); |
| 84 | +} |
| 85 | + |
| 86 | +class _CopyWithImpl$Mutation$M<TRes> implements CopyWith$Mutation$M<TRes> { |
| 87 | + _CopyWithImpl$Mutation$M( |
| 88 | + this._instance, |
| 89 | + this._then, |
| 90 | + ); |
| 91 | + |
| 92 | + final Mutation$M _instance; |
| 93 | + |
| 94 | + final TRes Function(Mutation$M) _then; |
| 95 | + |
| 96 | + static const _undefined = <dynamic, dynamic>{}; |
| 97 | + |
| 98 | + TRes call({ |
| 99 | + Object? bar = _undefined, |
| 100 | + Object? $__typename = _undefined, |
| 101 | + }) => |
| 102 | + _then(Mutation$M( |
| 103 | + bar: bar == _undefined ? _instance.bar : (bar as String?), |
| 104 | + $__typename: $__typename == _undefined || $__typename == null |
| 105 | + ? _instance.$__typename |
| 106 | + : ($__typename as String), |
| 107 | + )); |
| 108 | +} |
| 109 | + |
| 110 | +class _CopyWithStubImpl$Mutation$M<TRes> implements CopyWith$Mutation$M<TRes> { |
| 111 | + _CopyWithStubImpl$Mutation$M(this._res); |
| 112 | + |
| 113 | + TRes _res; |
| 114 | + |
| 115 | + call({ |
| 116 | + String? bar, |
| 117 | + String? $__typename, |
| 118 | + }) => |
| 119 | + _res; |
| 120 | +} |
| 121 | + |
| 122 | +const documentNodeMutationM = DocumentNode(definitions: [ |
| 123 | + OperationDefinitionNode( |
| 124 | + type: OperationType.mutation, |
| 125 | + name: NameNode(value: 'M'), |
| 126 | + variableDefinitions: [], |
| 127 | + directives: [], |
| 128 | + selectionSet: SelectionSetNode(selections: [ |
| 129 | + FieldNode( |
| 130 | + name: NameNode(value: 'bar'), |
| 131 | + alias: null, |
| 132 | + arguments: [], |
| 133 | + directives: [], |
| 134 | + selectionSet: null, |
| 135 | + ), |
| 136 | + FieldNode( |
| 137 | + name: NameNode(value: '__typename'), |
| 138 | + alias: null, |
| 139 | + arguments: [], |
| 140 | + directives: [], |
| 141 | + selectionSet: null, |
| 142 | + ), |
| 143 | + ]), |
| 144 | + ), |
| 145 | +]); |
| 146 | +Mutation$M _parserFn$Mutation$M(Map<String, dynamic> data) => |
| 147 | + Mutation$M.fromJson(data); |
| 148 | +typedef OnMutationCompleted$Mutation$M = FutureOr<void> Function( |
| 149 | + Map<String, dynamic>?, |
| 150 | + Mutation$M?, |
| 151 | +); |
| 152 | + |
| 153 | +class Options$Mutation$M extends graphql.MutationOptions<Mutation$M> { |
| 154 | + Options$Mutation$M({ |
| 155 | + String? operationName, |
| 156 | + graphql.FetchPolicy? fetchPolicy, |
| 157 | + graphql.ErrorPolicy? errorPolicy, |
| 158 | + graphql.CacheRereadPolicy? cacheRereadPolicy, |
| 159 | + Object? optimisticResult, |
| 160 | + Mutation$M? typedOptimisticResult, |
| 161 | + graphql.Context? context, |
| 162 | + OnMutationCompleted$Mutation$M? onCompleted, |
| 163 | + graphql.OnMutationUpdate<Mutation$M>? update, |
| 164 | + graphql.OnError? onError, |
| 165 | + }) : onCompletedWithParsed = onCompleted, |
| 166 | + super( |
| 167 | + operationName: operationName ?? 'M', |
| 168 | + fetchPolicy: fetchPolicy, |
| 169 | + errorPolicy: errorPolicy, |
| 170 | + cacheRereadPolicy: cacheRereadPolicy, |
| 171 | + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), |
| 172 | + context: context, |
| 173 | + onCompleted: onCompleted == null |
| 174 | + ? null |
| 175 | + : (data) => onCompleted( |
| 176 | + data, |
| 177 | + data == null ? null : _parserFn$Mutation$M(data), |
| 178 | + ), |
| 179 | + update: update, |
| 180 | + onError: onError, |
| 181 | + document: documentNodeMutationM, |
| 182 | + parserFn: _parserFn$Mutation$M, |
| 183 | + ); |
| 184 | + |
| 185 | + final OnMutationCompleted$Mutation$M? onCompletedWithParsed; |
| 186 | + |
| 187 | + @override |
| 188 | + List<Object?> get properties => [ |
| 189 | + ...super.onCompleted == null |
| 190 | + ? super.properties |
| 191 | + : super.properties.where((property) => property != onCompleted), |
| 192 | + onCompletedWithParsed, |
| 193 | + ]; |
| 194 | +} |
| 195 | + |
| 196 | +class WatchOptions$Mutation$M extends graphql.WatchQueryOptions<Mutation$M> { |
| 197 | + WatchOptions$Mutation$M({ |
| 198 | + String? operationName, |
| 199 | + graphql.FetchPolicy? fetchPolicy, |
| 200 | + graphql.ErrorPolicy? errorPolicy, |
| 201 | + graphql.CacheRereadPolicy? cacheRereadPolicy, |
| 202 | + Object? optimisticResult, |
| 203 | + Mutation$M? typedOptimisticResult, |
| 204 | + graphql.Context? context, |
| 205 | + Duration? pollInterval, |
| 206 | + bool? eagerlyFetchResults, |
| 207 | + bool carryForwardDataOnException = true, |
| 208 | + bool fetchResults = false, |
| 209 | + }) : super( |
| 210 | + operationName: operationName ?? 'M', |
| 211 | + fetchPolicy: fetchPolicy, |
| 212 | + errorPolicy: errorPolicy, |
| 213 | + cacheRereadPolicy: cacheRereadPolicy, |
| 214 | + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), |
| 215 | + context: context, |
| 216 | + document: documentNodeMutationM, |
| 217 | + pollInterval: pollInterval, |
| 218 | + eagerlyFetchResults: eagerlyFetchResults, |
| 219 | + carryForwardDataOnException: carryForwardDataOnException, |
| 220 | + fetchResults: fetchResults, |
| 221 | + parserFn: _parserFn$Mutation$M, |
| 222 | + ); |
| 223 | +} |
| 224 | + |
| 225 | +extension ClientExtension$Mutation$M on graphql.GraphQLClient { |
| 226 | + Future<graphql.QueryResult<Mutation$M>> mutate$M( |
| 227 | + [Options$Mutation$M? options]) async => |
| 228 | + await this.mutate(options ?? Options$Mutation$M()); |
| 229 | + graphql.ObservableQuery<Mutation$M> watchMutation$M( |
| 230 | + [WatchOptions$Mutation$M? options]) => |
| 231 | + this.watchMutation(options ?? WatchOptions$Mutation$M()); |
| 232 | +} |
0 commit comments