graphql-hive / graphql-hive/envelop
caching does not work if we have introspection query inside graphiql using express-graphql with @envelop/response-cache
- Dominant language
- No language data
- Stars
- 827
- Forks
- 132
- PR merge metrics
- No merged PRs in 30d
Description
### Issue workflow progress
_Progress of the issue based on the [Contributor Workflow](https://github.com/the-guild-org/Stack/blob/master/CONTRIBUTING.md#a-typical-contributor-workflow)_
- [x] 1. The issue provides a [minimal reproduction](https://en.wikipedia.org/wiki/Minimal_reproducible_example) available on [Stackblitz](https://stackblitz.com/fork/node).
- _Please install the latest `@envelop/*` packages that you are using._
- _Please make sure the reproduction is as small as possible._
- [ ] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review
---
**Describe the bug**
- when having the text that is stored in `./graphiql-not-caching-requests` in the
graphiql playground the @envelop/response-cache plugin does not cache
requests.
- when having the text that is stored in `./graphiql-caching-requests` it will
**To Reproduce**
Steps to reproduce the behavior:
- clone https://github.com/xddq/envelop-respones-cache-graphiql-issue
- `yarn`
- `yarn build`
- `yarn start`
- go to `localhost:4000/graphql` and copy paste the text of
`./graphiql-not-caching-requests`. Then run "hello" and see that it won't be
cached.
- go to `localhost:4000/graphql` and copy paste the text of
`./graphiql-caching-requests`. Then run "hello" and see that it will be
cached.
**Expected behavior**
- Cache results of the "hello" query in both cases
**Environment:**
- OS:
- NodeJS:
- `@envelop/*` versions: 3.0.0
- `@envelop/core`: 2.4.0
**Additional context**
I am not sure why this is happening. One thing I did notice that when testing that the other caching plugins `@envelop/parser-cache` and `@envelop/validation-cache` still work as usual. I also don't think that this bug is severe, since it occurs only if we have the introspection query in graphiql.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.