aws-amplify / aws-amplify/amplify-codegen

Generated dart client doesn't contain custom query/mutation

Open
#902 0 comments 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
TypeScript
Stars
59
Forks
64
PR merge metrics
No merged PRs in 30d

Description

### Describe the feature you'd like to request

Custom queries and mutations should be generated.

### Describe the solution you'd like

Custom queries and mutations should be generated.

### Describe alternatives you've considered

N/A

### Additional context

Currently, according to [the doc](https://docs.amplify.aws/flutter/build-a-backend/data/custom-business-logic/#step-3---invoke-the-custom-query-or-mutation) we have to manually construct the query and parse the response like this:

```dart

const graphQLDocument = '''
query Echo(\$content: String!) {
echo(content: \$content) {
content
executionDuration
}
}
''';

final echoRequest = GraphQLRequest(
document: graphQLDocument,
variables: {"content": "Hello world!!!"},
);

final response =
await Amplify.API.query(request: echoRequest).response;
safePrint(response);

Map jsonMap = json.decode(response.data!);
EchoResponse echoResponse = EchoResponse.fromJson(jsonMap);
safePrint(echoResponse.echo.content);
```

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request

### Would this feature include a breaking change?

- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.