GraphQL: disable caching if `devMode` is on & `cacheDuration`
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
It can be a little hairy to debug GraphQL since caching is enabled regardless of whether devMode is on or not:
https://github.com/craftcms/cms/blob/develop/src/services/Gql.php#L289
In addition, perhaps rather than passing in null for the duration (meaning cache forever):
https://github.com/craftcms/cms/blob/develop/src/services/Gql.php#L340
...perhaps it makes sense to use the cacheDuration general config setting (or at a new gqlCacheDuration) config setting, and use that?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/services/Gql.php around lines 289 and 340, then review the cacheDuration configuration setting linked in the issue. Decide whether devMode should disable caching and whether the existing setting or a new gqlCacheDuration should control the duration. Done means the GraphQL caching behavior follows the chosen configuration consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, php
- Domain
- api, performance
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100