-
-
Notifications
You must be signed in to change notification settings - Fork 535
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 using tuple (and/or iterable) as an alias to the GraphQL type #2035
Comments
I think that a more general |
patrick91
pushed a commit
that referenced
this issue
Sep 12, 2022
* Convert Tuple and Sequence types to GraphQL List types To help with typing resolvers correctly, this PR updates the logic to determine if an annotation is GraphQL List type by checking against the Tuple and Sequence types. Fixes #2035 and #2161 Diff-Id: e22a7 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Support added in v0.130.0 |
However, if the tuple is |
@dperetti good catch! I think in this case we should probably throw an error, what do you think? |
@patrick91 yeah, along with a reminder that GraphQL doesn't support tuples anyway! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Request Type
Alteration (enhancement/optimization) of existing feature(s)
Description
Returning a
tuple
when the attribute is hinted aslist
works.But hinting the return type correctly as a tuple causes an error:
Our code uses tuples and iterables whenever appropriate for robustness, efficiency, and documentation. We also use strict type hinting. It'd be great for these read-only sequences to be explicitly supported.
The text was updated successfully, but these errors were encountered: