-
Notifications
You must be signed in to change notification settings - Fork 32
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
Feature request: enable retrieval of the entire query #185
Comments
Hey antcin! So, I'm not sure if they are going to prioritize this at all since the data is actually available, its just overly complicated to access. I stumbled across a library called ast-to-query. https://www.npmjs.com/package/graphql-ast-to-query Unfortunately for me, every time I used this library I had errors (it looked like it was unprocessed tpyescript causing the error). So I ended up tinkering with that library to resolve the issue. Here is a variation that is currently workin inside my production environment. I used this to grab the query and then redirect to my graphQL. I am using a lambda as my parent gateway, alongside apollo-lambda-server the parent gate way is breaking my request into pieces and sending it to the correct graphQL microservice end point. Here is the "buildQuery" function I am using, you'll notice that astToQuery actually does 100% of the work, and then I do some string modifications to get my desired result.
info.operation is what you pass inside of astToQuery Additionally I wanted to add that $context.info.selectionSetGraphQL is actually only going to give you the query if you are using mapping templates, the documentation only states this within the mapping-templates section and nowhere else. |
Hey @codymurphyjones! Sorry for the very late response! Thank you for having found the time to reply to my message, this looks interesting. I will have take a deeper look at |
2 years later, I cannot find any sign of this |
@Tenrys it's there but you have to extract it manually in resolver from
|
That is only part of the GraphQL request. |
That is how it is intended to be. You can pass data from your request to your response if you need it. |
Following conversation with the AWS Support Team, I was advised to open an issue to request the following.
Request
Allow for Appsync to return an entire GraphQL query from the
context
.Current state
According to the Info section in the documentation, the
$context.info.selectionSetGraphQL
value should return the entire query, however it only returns a selection of it.The Support Team confirmed that there is no supported mechanism to get the entire query today.
Why am I requesting this
I would like to proxy queries from one Appsync endpoint to another.
Refer also to thread in the Discussion Forum for AWS Appsync.
The text was updated successfully, but these errors were encountered: