Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Support iterable return types #447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support iterable return types #447

wants to merge 1 commit into from

Conversation

blakeembrey
Copy link
Contributor

GraphQL uses iterall and supports Iterable return values. This PR changes all return types to be iterable and keeps input types as arrays.

@jasonkuhrt
Copy link
Member

jasonkuhrt commented Feb 11, 2019

Thanks @blakeembrey

  • Could you give a motivating use-case?
  • IIUC this proposes to allow any iterable to satisfactorially resolve a graphql schema list type, and graphql-js set this precedent
  • I will play around a bit to better understand how loose this lets developers get with their resolvers.

@blakeembrey
Copy link
Contributor Author

@jasonkuhrt I ran into this in my personal projects, where I tend to do more things in iterables lately with tools like https://github.com/blakeembrey/iterative. The major place this does get loose is strings, since everything else would work with graphql-js (https://github.com/graphql/graphql-js/blob/d55f6d364ada22c122c718ddf74951b20ef0b17b/src/execution/execute.js#L944 and https://github.com/leebyron/iterall/blob/76ce9a54b50fd9ae306e5f9fce6e2ab44618b65b/index.mjs#L164).

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

Successfully merging this pull request may close these issues.

2 participants