unable to set api key auth on custom mutation #14226
Labels
GraphQL
Related to GraphQL API issues
pending-maintainer-response
Issue is pending a response from the Amplify team.
pending-triage
Issue is pending triage
Before opening, please confirm:
JavaScript Framework
Not applicable
Amplify APIs
GraphQL API
Amplify Version
v6
Amplify Categories
Not applicable
Backend
Amplify Gen 2
Environment information
Describe the bug
I have this schema:
And I am unable to set
.authorization((allow) => [allow.publicApiKey()]),
on theexecuteStateMachine
mutation.I am getting this error:
Expected behavior
I should be able to set my API Key as authorization to the custom operation without the need of specifying a custom authorization handler and deploy a function.
As a matter of fact, if I go on the AppSync console and manually add
@aws_api_key
to the schema and deploy it manually, everything works.This used to work in a previous version of Amplify Gen 2, but at some point it broke.
Reproduction steps
See the code above.
Code Snippet
See above, or look at this aws-samples repo that got broken as result.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: