Comments (9)
Available in v0.1.16!
from graphql-mesh.
I think you need to overwrite headers. So you can add your own headers using operationHeaders mesh config. And add content-type with */*
.
from graphql-mesh.
How can I debug if the operation is using the correct request headers. Added the operationHeaders but still same error.
from graphql-mesh.
You can compare the request coming from Mesh and working another one you send.
from graphql-mesh.
I have the same issue, my external server returns application/vnd.api+json; charset=utf-8
instead of application/json
. I've tried to add operationHeaders, no luck.
Error
Unexpected error value: \"Operation GET /applications should
have a content-type 'application/json' but
has 'application/vnd.api+json; charset=utf-8' instead\"
from graphql-mesh.
Could you share your mesh configuration @sviatoslav-lebediev ?
from graphql-mesh.
Sure, I've tried different variations but got the same error.
sources: - name: bakery
handler:
openapi:
baseUrl: https://bakery.dev.host.net/api/v1
source: ./swagger.json
operationHeaders:
Content-type: "*/*"
Accept: "*/*"
Authorization: ....
and
sources: - name: bakery
handler:
openapi:
baseUrl: https://bakery.dev.host.net/api/v1
source: ./swagger.json
operationHeaders:
Content-type: application/vnd.api+json; charset=utf-8
Accept: application/vnd.api+json; charset=utf-8
Authorization: ....
I've tried lowercase Content-type
and Accept
as well.
from graphql-mesh.
Same error with stackexchange api(openapi 2.0)
query:
{
getQuestions(site:"stackoverflow")
}
response:
{
"errors": [
{
"message": "Unexpected error value: \"Operation GET /questions should have a content-type '*/*' but has 'application/json; charset=utf-8' instead\"",
"locations": [],
"path": [
"getQuestions"
]
}
],
"data": {
"getQuestions": null
}
}
example:
https://codesandbox.io/s/stackexchange-apiguru-m6j5x
Note: corresponding API can be tested via running yarn swagger
with in shared codesandbox
from graphql-mesh.
#248 (comment)
FYI -> my issue is resolved after #358
Thanks!
from graphql-mesh.
Related Issues (20)
- Could Not Find Module for relative imports when mocking HOT 1
- JSON-Schema issues with required + nullable=true fields HOT 1
- HTTP cache broken if response includes multiple headers of the same name HOT 1
- mesh build --throwOnInvalidConfig does not throw on invalid config
- RPC Method Named 'Close' Conflicts with Client Connection Close Operation in GraphQL Mesh gRPC Handling
- Response types from OAS response schema $ref
- Feedback for “Extend Transform (experimental)”
- Feedback for “Operation Field Permissions”
- HTTP cache returns unusable response if TTL = 0 => server hangs indefinitely
- Easily access underlying API responses HOT 2
- TypeScript strict null checks
- graphql-mesh with gRPC and openapi handlers + global transform results in cached variables HOT 1
- `@omnigraph/openapi`: OpenAPI array values not converted correctly into GraphQL
- mysql HOT 1
- Using enum in swaggers break other routes HOT 5
- prometheus config not working HOT 4
- Supergraph handler fails with same field name HOT 2
- SDK return types are misleading
- transform-hive does not support SelfHosting
- Format check in CI HOT 3
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.