I have the following query:
query xxx {
getSomething(id: "id") {
field1
field2
}
}
Is there any way for me to get field1
and field2
in lambda? For example, to query only those fields in mysql, not get all of them just to be discarded by AppSync later.
I tried logging all the $context
in the request mapper VTL file but they are not there. Any ideas? Seems quite stupid to not be able to do that. The only thing I get in lambda is the id
argument.
Thanks, Mihai
It might not be the answer you want to hear, but as you've spotted AppSync simply doesn't make the graphql (fields, or otherwise) available to you.
The only two 'options" I can put to you are:
getThingFromTableA
and getThingFromTableB
rather than just getThing
){ cheapA, cheapB, expensiveA { expensiveTableAThingA, expensiveTableAThingB }, expensiveB }
).n.b. it isn't that uncommon, for example Apollo doesn't by default either.