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

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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ