how to put variable into a string as a prefix of function in Graphql?

0

As title, we have a graphql file in amplify, and we have a need to put a variable at the start of lambda function name. e.g. type Query { grantDeviceToken(macs: [String!]!): GrantTokenResponse @function(name: "${site}-appsyncGrantDeviceToken-${env}") } As this example, is it possible to make ${site} as a variable and how do I setup the variable value?

thankshow to put variable into a string as a prefix of function in Graphql? As title, we have a graphql file in amplify, and we have a need to put a variable at the start of lambda function name. e.g.

type Query { grantDeviceToken(macs: [String!]!): GrantTokenResponse @function(name: "{site}-appsyncGrantDeviceToken-${env}") }

As this example, is it possible to make ${site} as a variable and how do I setup the variable value?

thanks

已提问 2 年前198 查看次数
1 回答
1

Hello, I understand that you would like to set lambda resolver name dynamically using a variable(“site”). Please note that according to the documentation the @function directive allows you to use ${env} to reference the current Amplify CLI environment.

However, I could not see any resources/documentation discussing an out of box approach to create variables which could be accessed in the GraphQL schema as mentioned by you. Having said that, please feel free to raise a feature request with the Amplify service team via the GitHub.

In case I misunderstood the query, please feel free to reach out to us via creating a support case from the support centre dashboard and elaborate your usecase in detail.

AWS
支持工程师
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容