Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow returning arbitrary values #14

Open
jacob-israel-turner opened this issue Aug 28, 2020 · 6 comments
Open

Allow returning arbitrary values #14

jacob-israel-turner opened this issue Aug 28, 2020 · 6 comments

Comments

@jacob-israel-turner
Copy link

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?

@PatrickJS
Copy link
Owner

yeah that makes sense

@jacob-israel-turner
Copy link
Author

Cool - how can I help?

@PatrickJS
Copy link
Owner

@jacob-israel-turner
Copy link
Author

Hmm, I don't think so. From reading that code, if a non-object is passed in, it should just pass it through directly. However, according to @mahcloud, if a non-object is passed in, an error is thrown. I can look at getting the specific error if that's helpful.

@PatrickJS
Copy link
Owner

yeah, we're thinking about rewriting the package in typescript too so any problems you run into let me know

@paul-vd
Copy link

paul-vd commented Jul 20, 2022

Hi @PatrickJS I was wondering if there was any progress on this topic, or anything we may track which is related to this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants