amplify-codegen
amplify-codegen copied to clipboard
Generated dart client doesn't contain custom query/mutation
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 we have to manually construct the query and parse the response like this:
const graphQLDocument = '''
query Echo(\$content: String!) {
echo(content: \$content) {
content
executionDuration
}
}
''';
final echoRequest = GraphQLRequest<String>(
document: graphQLDocument,
variables: <String, String>{"content": "Hello world!!!"},
);
final response =
await Amplify.API.query(request: echoRequest).response;
safePrint(response);
Map<String, dynamic> 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