@@ -112,13 +112,12 @@ The example client query below allows you to query for "Customer" records based
112
112
``` dart title="lib/main.dart"
113
113
import 'package:amplify_api/amplify_api.dart';
114
114
import 'package:amplify_flutter/amplify_flutter.dart';
115
- import 'amplify_outputs.dart';
116
115
import 'models/ModelProvider.dart';
117
116
118
117
// highlight-start
119
118
final request = ModelQueries.list(
120
119
Customer.classType,
121
- where: accountRepresentativeId .eq(YOUR_REP_ID),
120
+ where: Customer.ACCOUNTREPRESENTATIVEID .eq(YOUR_REP_ID),
122
121
);
123
122
// highlight-end
124
123
@@ -214,13 +213,12 @@ The example client query below allows you to query for "Customer" records based
214
213
``` dart title="lib/main.dart"
215
214
import 'package:amplify_api/amplify_api.dart';
216
215
import 'package:amplify_flutter/amplify_flutter.dart';
217
- import 'amplify_outputs.dart';
218
216
import 'models/ModelProvider.dart';
219
217
220
218
// highlight-start
221
219
final request = ModelQueries.list(
222
220
Customer.classType,
223
- where: Customer.accountRepresentativeId .eq(YOUR_REP_ID) & Customer.name.begins ("Rene"),
221
+ where: Customer.ACCOUNTREPRESENTATIVEID .eq(YOUR_REP_ID) & Customer.NAME.beginsWith ("Rene"),
224
222
);
225
223
// highlight-end
226
224
@@ -301,6 +299,43 @@ let queriedCustomers = try await Amplify.API.query(
301
299
```
302
300
</InlineFilter >
303
301
302
+ <InlineFilter filters = { [" flutter" ]} >
303
+
304
+ In your client app code, you can use the updated query name.
305
+
306
+ ``` dart title="lib/main.dart"
307
+ import 'package:amplify_api/amplify_api.dart';
308
+ import 'package:amplify_flutter/amplify_flutter.dart';
309
+ import 'models/ModelProvider.dart';
310
+
311
+ var accountRepresentativeId = "John";
312
+ var operationName = "listByRep";
313
+ var document = """
314
+ query ListByRep {
315
+ $operationName(accountRepresentativeId: "$accountRepresentativeId") {
316
+ items {
317
+ accountRepresentativeId
318
+ createdAt
319
+ id
320
+ name
321
+ phoneNumber
322
+ updatedAt
323
+ }
324
+ nextToken
325
+ }
326
+ }
327
+ """;
328
+
329
+ final request = GraphQLRequest(
330
+ document: document,
331
+ variables: {
332
+ 'accountRepresentativeId': accountRepresentativeId,
333
+ 'operationName': operationName,
334
+ },
335
+ );
336
+ ```
337
+ </InlineFilter >
338
+
304
339
305
340
## Customize the name of secondary indexes
306
341
0 commit comments