hasura / hasura/graphql-engine
Hasura caching issue when using remote schema and graphql mesh
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: 2.41.0
### Environment
Cloud
### What is the current behaviour?
I am working with remote-schemas for which I am using graphql-mesh and Kotlin as BE with openapi.json
I created a test endpoint on Kotlin BE, for which I am sending a mutation request from Hasura.
This is the request
`mutation MyMutation ($input: CacheTestRequestInput_gbo) {
backoffice {
performCachingTest(input: $input) {
... on CacheTestResponse_gbo {
__typename
body
}
}
}
}`
For the above request, I am sending various values on input parameters
`{
"input":{"body":"apple1", "id":"1", "count": "ABCD"}
}`
And this is the response I get
`{
"data": {
"backoffice": {
"performCachingTest": {
"__typename": "CacheTestResponse_gbo",
"body": "id=[1], body=[apple1], count=[ABCD]"
}
}
}
}`
Now, if I trigger a request again, with a different body, let's say
`{
"input":{"body":"apple20", "id":"5", "count": "ABCD"}
}`
I still get the previous response.
However, if I try to send the request later (let's say after 1-2 minutes), I get the correct payload.
It is not a Kotlin BE issue, it is not a graphql mesh issue. Why I do say that?
Because I tried to send request straight to graphql mesh avoiding it to pass through Hasura, and I have no issue if I do it like that.
I suspect is some Hasura caching issue I am not aware of.
### What is the expected behaviour?
Expected behaviour is that no mater what values I send for input parameters, and no mater how quickly I send the request, I want to be able to obtain request:response, so a match 1:1. If I send apple1, to receive as response apple1. If I send HelloWorld133 to receive as response HelloWorld133 and not apple1 (previous request response)
### How to reproduce the issue?
1. Create a BE endpoint (Kotlin or whatever BE you want)
2. Use openapi.json for schema
3. create a graphql-mesh server to serve the requests
4. configureHasura remote-schema
5. trigger the mutation request
### Screenshots or Screencast
Trial 1: I get correct response

Trial 2: Changing body, and getting same response

### Please provide any traces or logs that could help here.
Inspecting payload

Inspecting response

### Any possible solutions/workarounds you're aware of?
### Keywords
hasura request to remote schema sends wrong payload but it works properly if I avoid sending request through Hasura
Contributor guide
Assessment
This issue has not been assessed yet.