refactor graphql.NoCache. use string type keys #3332
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #3331
All internal uses of cache use string type keys and leaves out the value type as generic parameter. The new generic
NoCache
implementation only allows specifying the key type and the value type is a pointer of the key type. Meaning if I specify the key typestring
the value type is*string
. This implementation cannot be assigned in place ofgraphql.Cache[any]
I propose to fix this by updating the
NoCache
definition by dropping the key type and allowing to use only string as key, any as valueSee #3179