hasura / hasura/graphql-engine

Hasura caching issue when using remote schema and graphql mesh

Open
#10,485 10 comments 3 reactions 1 assignee Claimed by @rakeshkky View on GitHub
c/server c/v2-engine k/bug v2 v2-server
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
![image](https://github.com/user-attachments/assets/5b25b0db-be02-4baa-97bf-87cec8eac8e9)
Trial 2: Changing body, and getting same response
![image](https://github.com/user-attachments/assets/a8ec840a-07ed-4a43-9bfb-54ce040eba97)

### Please provide any traces or logs that could help here.
Inspecting payload
![image](https://github.com/user-attachments/assets/1d412a23-5987-49ed-af52-aba06315ce0d)
Inspecting response
![image](https://github.com/user-attachments/assets/57710b0f-3e54-450f-b516-03dc705e0ed2)
### 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.