Comments (4)
A bit more context : it seems to happen only for operations with a return type marked as "JSON"
Examples :
query me { identity: GetUser { id } }
=> I receive an error
"errors": [
{
"message": "HTTP Error: 401, Could not invoke operation <redacted>",
query systemStatus {
SystemStatus
}
=> I do NOT receive an error
{
"data": {
"SystemStatus": ""
}
}
The only difference I can see is that the query SystemStatus is defined like SystemStatus: JSON
whereas the query GetUser has a "proper" return GetUser: UserInfo
from graphql-mesh.
Could you give more details about your setup? What kind of source are you using? OpenAPI? SOAP? GraphQL?
For GraphQL, GraphQL Mesh forwards the response as-is.
For OpenAPI, only if there is a response for 401 status code, GraphQL Mesh returns the exact response. GraphQL Mesh throws an error if there is no defined response in the OpenAPI spec for that specific status code.
If you don't want Mesh to handle other status codes, you can set ignoreErrorResponses: true
so in that case Mesh will only handle 2xx status codes, and throw others.
from graphql-mesh.
I'm using OpenAPI
Below is the extract of the OpenApi for both operations (they are in the same source)
note : I cannot provide the whole doc as is, I'd need to clean everything except these 2 operations, please ask if needed
None of them specify the 401 return code, so it should throw based on your explanation
I do want graphql mesh to handle the described errors (like "400" for example) so I do not want to use ignoreErrorResponses
I'm attaching the logs of Graphql mesh for both queries (I redacted the URLs, the tokens, ...)
logs-graphql-mesh.zip
you will see that the server answers the same response in both cases but the difference is at the end
Extract for the systemStatus
๐ ๐ธ๏ธ Mesh - Identity - Query.SystemStatus => Return type is not a JSON so returning
Here is the relevant OpenApi
/systemSstatus:
get:
operationId: SystemStatus
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
additionalProperties:
type: boolean
text/json:
schema:
type: object
additionalProperties:
type: boolean
/user-info:
get:
operationId: GetUser
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/UserInfo'
from graphql-mesh.
Adding the screenshot of the diff
from graphql-mesh.
Related Issues (20)
- Renamed input type field on graphql source is missing when using multiple sources
- Custom schema polling mechanism
- Batching for N+1 problem with objects HOT 1
- serve-cli: If uWebSockets is unable to be installed, use node:http
- Project Roadmap
- context missing in responseCache ifdef HOT 1
- Set headers from grpc source HOT 2
- Schema generation error for Swagger 2.0 default object value HOT 5
- Project Roadmap
- Project Roadmap
- Project Roadmap
- Project Roadmap
- Schema generation is non-deterministic
- Document `UWS_HTTP_MAX_HEADERS_SIZE`
- TLS configuration for โRedis Cacheโ HOT 1
- With encapsulate transform, it is not possible to point to the root types
- Fails on Abacus OData schema
- ODATA query parameters not url-encoded
- Disabling any resolver on a Mongoose model fails to generate the schema HOT 3
- Error: No `subscribe` function found! Register it using "useEngine" plugin. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-mesh.