@omnigraph/openapi: How to differentiate between success/fail when API returns 204 without a response body? #8128
Unanswered
blakel6819
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am encountering issues using loadOpenAPISubgraph to generate a subgraph from a restful API with a path that has no response body type and only returns the the following responses:
The Mutation generated from the OpenAPI schema has no response type defined.
The issue I am facing is that there is no way of determining if the request was successful or failed as the returned data is always the following:
With DEBUG enabled "Return type is not a JSON so returning" is logged (which indicates that the following line is hit) when trying to parse the response text:
As no response type is defined for the Mutation, when the HTTP response is 401 I would have expected the else to be hit that returns and error which would allow distinction between a success vs fail response:
Is there a way to configure the subgraph generated using loadOpenAPISubgraph to be able to return a response that can be differentiated between a success or failure based on the HTTP status response when a mutation has no return type?
Beta Was this translation helpful? Give feedback.
All reactions