Reputation: 42484
I am using Appsync as graphql server. I have read through this article https://aws.amazon.com/blogs/mobile/using-multiple-authorization-types-with-aws-appsync-graphql-apis/ which allows me to use multiple authorisation methods in graphql.
I have two fields on graphql schema which require API Key authorization. Can I assign one key for one field and a different key for different field?
By looking at the @aws_api_key
, it doesn't have extra parameter like name
or something. It seems that if a field is authorized by API_KEY, it can be accessed by any API KEY generated by the appsync.
Can I create one APIKEY for a particular field? I am looking for something like below schema:
getAllPosts(): [Post]
@aws_api_key(key1)
updatePost(post: Post): Post
@aws_api_key(key2)
I'd like to use key1
for getAllPosts
and key2
for updatePost
. How can I achieve this in appsync?
Upvotes: 3
Views: 921
Reputation: 6158
No you can't use multiple API keys on a single API. However you can configure multiple user pools if you use Amazon Cognito.
Upvotes: 3