We're looking at using this library to wrap a portion of our existing data loader implementation. A headache that has come up is that redis-dataloader does not allow returning primitives, only JSON. This makes consuming data loaders that return, for example, a simple count, somewhat more cumbersome. It is achievable by returning something like { count: 21 }, but then every consumer (generally GraphQL type resolvers) must pull that value out of the response from the data loader.
Is there a reason that redis-dataloader could not allow arbitrary primitives, such as numbers?
We're looking at using this library to wrap a portion of our existing data loader implementation. A headache that has come up is that
redis-dataloaderdoes not allow returning primitives, only JSON. This makes consuming data loaders that return, for example, a simple count, somewhat more cumbersome. It is achievable by returning something like{ count: 21 }, but then every consumer (generally GraphQL type resolvers) must pull that value out of the response from the data loader.Is there a reason that
redis-dataloadercould not allow arbitrary primitives, such as numbers?