-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintenance: AppSyncResolverEvent uses typeName
instead of parentTypeName
#5560
Comments
Hi @aminalaee! Thanks for reporting this! I'll check on Monday, but I think we have a bug here. The reason I'll check out this is because we use some of these fields in our |
Thanks, And about your point of this usage, I think it's kind of the same that in other places
|
Hi @aminalaee! Sorry for the late reply, I'm working on a fix until the end of this week and will let you know when we release it. Thanks a lot for pointing that out. |
Hey @aminalaee! I sent a PR to fix this, and it will be released in the first (or second) week of January. I apologize for the delay in fixing this. We have been very busy this month and last month. |
|
Why is this needed?
I'm new to GraphQL in general, but I think in the original PR #323 the
AppSyncResolverEvent
was based on AWS Amplify, so instead of readingparentTypeName
, we are readingtypeName
.It confused me that the code is consistent (in some ways) with AWS AppSync Context info:
But we are assigning variables in a way they are not clear:
powertools-lambda-python/aws_lambda_powertools/utilities/data_classes/appsync_resolver_event.py
Line 161 in a3f3359
And we define different property names for reading the
parentTypeName
:powertools-lambda-python/aws_lambda_powertools/utilities/data_classes/appsync_resolver_event.py
Lines 121 to 124 in a3f3359
powertools-lambda-python/aws_lambda_powertools/utilities/data_classes/appsync_resolver_event.py
Lines 165 to 168 in a3f3359
This has the side-effect that when setting up an AppSync resolved in AWS like the following, it does not work out of the box and you have to pass
typeName
to make it work:Which area does this relate to?
Event Source Data Classes
Solution
I'm not sure if it was the intention and it should stay the same, but I think we can improve this in different ways:
parent_type_name
should be usedinfo
fromparentTypeName
aftertypeName
is checked. This way it is consistent with the AWS Resolver context here and with the Amplify structureI can prepare a PR if the suggestion makes sense.
Acknowledgment
The text was updated successfully, but these errors were encountered: