Replies: 1 comment
-
Hi ! The line you are pointing out is handling a special case: it handles null and empty collections. If a field is null or an empty Array, no entity will be gathered, and the link between the type of the entity (if it was actually present) and the operation is lost. So this line tries to infer the "type of null" or the "type of empty array". But it should not be ever-growing, it is created with each operation, should be stored along with this operation cache and have the same TTL. That being said, you are right that scalars should not be gathered. We should add a guard so that we only keep track of ObjectType types. Can you open an issue for this ? It's clearly a bug ! If you want and have time for it, PR are also very welcomed ! And we are here to answer any question and help you if needed :-) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Because of this line https://github.com/graphql-hive/envelop/blob/main/packages/plugins/response-cache/src/plugin.ts#L473 response cache will store a set for scalars like String, Float, or Int whenever there is a null value in the field.
Such set seems pointless to me, as it would basically just allow to "invalidate all operations that have a null Float in the response", which makes no sense.
Am I getting this wrong? This just means that in redis it will create an infinitely growing set with no use. Of course, I can set up a cron job to delete it regurarly, but what is the point of such set?
Beta Was this translation helpful? Give feedback.
All reactions