-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set enum to arguments in Function Mutation #2575
Comments
Hey👋, thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂 |
The same is true for refs: createTodo: a
.mutation()
.arguments({
name: a.string().required(),
title: a.string().required(),
type: a.ref("TodoType"), // Type 'RefType<RefTypeArgFactory<"TodoType">, never, undefined>' is not assignable to type 'BaseModelField | EnumType<readonly string[]>'.
})
.returns(a.ref("TodoResponse"))
.authorization((allow) => [allow.authenticated()])
.handler(a.handler.function(defineFunction("createTodo"))), |
Hey @kita3222, Thanks for raising this. We can reproduce the issue. Hence, marking this as a bug for the team to evaluate further. |
Hi @kita3222, we just added support for this feature. Please run the following to update your dependencies: npm install @aws-amplify/backend@latest @aws-amplify/backend-cli@latest aws-amplify@latest
npm update @aws-amplify/data-schema |
This issue is now closed. Comments on closed issues are hard for our team to see. |
I am still unable to assign a ref |
Environment information
Description
When I try to set ENUM in the arguments of the Function Mutation, I get the following error and cannot do a sandbox deploy.
This is the definition of my function:
The text was updated successfully, but these errors were encountered: