Hi all. I’m having trouble figuring out how to pa...
# singer-tap-development
s
Hi all. I’m having trouble figuring out how to pass variables to a graphql request. How do I call
prepare_request_payload()
to that I can pass it params. So far, I overrode get_url_params in my stream, but they were appended to the end of the query instead of being added as variables.
a
@stephen_lloyd - You might find this example of a NewRelic GraphQL tap from @julian_knight helpful. Also, Julian opened this related issue which has since been resolved in this MR. You should be able to pass your variable values in
get_url_params()
without overloading
prepare_request_payload()
. As uncovered in the above issue from Julian, you may also need to ensure your
GraphQLStream.query
text includes the fully wrapped syntax:
query ($<paramName>: <type>, …) { <query_text> }
. This should be pretty clear if you reference the query example and
get_url_params()
from Juian’s working NewRelic tap. Hope this helps!
s
@aaronsteers Thanks. This was helpful.