Skip to content
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

GraphQL: how to know which fields are requested ? #13850

Closed
cscetbon opened this issue Jul 10, 2024 · 2 comments
Closed

GraphQL: how to know which fields are requested ? #13850

cscetbon opened this issue Jul 10, 2024 · 2 comments
Labels
pending-triage Issue is pending triage question General question

Comments

@cscetbon
Copy link

Amplify CLI Version

12.12.4

Question

I'm using aws amplify with a lambda function as a AppSync resolver. In my schema I'm not using a model as I'm using another database than DynamoDB. When I get the event passed to my lambda, I don't see the requested fields, is there anything to do in order to have access to this information and request only those specific fields instead of querying everything from my database ? I don't see anything mentioned at https://docs.amplify.aws/gen1/javascript/build-a-backend/graphqlapi/custom-business-logic/#structure-of-the-function-event

@cscetbon cscetbon added pending-triage Issue is pending triage question General question labels Jul 10, 2024
@cscetbon
Copy link
Author

Found it ! I just needed to override the generate request template and put

      "selectionSetList": $util.toJson($ctx.info.selectionSetList),

The reason it was not there is because it's not serializable in $ctx.info by default !

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-triage Issue is pending triage question General question
Projects
None yet
Development

No branches or pull requests

1 participant