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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠