Replies: 1 comment
-
There was a bug, they fixed it at |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm implementing some REST APIs through Hasura Actions with Request Options Transformation and Payload Transformation. I've implemented a PostalCode API with a Get request which uses a body. After that I started to implement Mollie. The Create Payment request works which is a Post with a body.
Now I'm trying to implement the Get Payment request which is a Get without a body. This is were I get stuck.
I tried calling the endpoint in Postman. If I use a get without a body, it succeeds. If I call the endpoint with an empty JSON object in the body, the call succeeds. If I put anything in the JSON object, e.g,
{ "foo": "bar" }
the request fails with messageNon-existent body parameter \"foo\" for this API call
.I added a Action named getPayment.
Action definition
type Query { """ getPayment """ getPayment( id: String! ): getPaymentOutput }
Type configuration
type getPaymentOutput { status: String! }
Webhook (HTTP /S) Handler
https://api.mollie.com/v2/payments/
Headers
Authorization: Bearer test_xxxxxxxxxxxxxx
Request Method
GET
Request URL Template
{{$base_url}}{{$body.input.id}}
which results in https://api.mollie.com/v2/payments/tr_beyf7df when the value of id is set to tr_beyf7dfWith the Request body I have tried different things which results in different output.
Non-existent body parameter \"request_query\" for this API call
. So instead of transforming the request it just puts the GraphQl query as the body. Which makes sense.{}
The JSON request body does not represent an object
. What happens is that instead of putting {} as the body, it sets it as"null"
{ "id": {{$body.input.id}} }
Non-existent body parameter \"id\" for this API call
. Which also makes sense because this is the same error when I try this in Postman. I tried this just to check if I would get the same error.I've tried some other things with the Request Body like setting it to
null
or try to escape the{}
or using multiple brackets. But I can't seem to get Hasura to just send an empty object as the body, or no body at all.I noticed that the action has the template engine Kriti which I looked in to but also can't find how to make it return an empty JSON object.
Can anybody help met with this?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions