sbstjn / appsync-resolvers

AWS AppSync Resolvers for GraphQL using AWS Lambda functions in Go.
https://sbstjn.com/serverless-graphql-with-appsync-and-lambda.html
MIT License
42 stars 13 forks source link

Make context object available to resolver func #12

Open asterikx opened 4 years ago

asterikx commented 4 years ago

Currently, resolver functions are invoked only with the GraphQL arguments or the resolved field. The identity field or any other (possibly user-defined) field of the $context object is dropped.

https://github.com/sbstjn/appsync-resolvers/blob/08cb572f11cd9cf4088e0af5f1e005c2bf3d58ed/repository.go#L27

This makes it impossible to perform resource-based authorization based on $context.indentity.username or $context.identity.cognitoIdentityId (see AWS AppSync Developer Guide) in Lambda resolvers.

gusdecool commented 1 year ago

Hi @asterikx , try to use the Kovel forked which have resolved this. Here is the link https://github.com/kovel/appsync-resolvers