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 null in input list #749

Closed
altaurog opened this issue May 30, 2018 · 5 comments
Closed

allow null in input list #749

altaurog opened this issue May 30, 2018 · 5 comments

Comments

@altaurog
Copy link

I would like to be able to create a range search parameter as a list of possibly null values, so I could do something like the following:

range query
amps < 3 components (amps: [null, 3])
1 < amps < 3 components (amps: [1, 3])
1 < amps components (amps: [1, null])

Input List type doesn’t seem to allow this. I get an Unexpected Name "null" error

@altaurog
Copy link
Author

altaurog commented May 30, 2018

In this case I could just use a string with comma-separated values:

range query
amps < 3 components (amps: ",3")
1 < amps < 3 components (amps: "1,3")
1 < amps components (amps: "1,")

But I would lose some type safety that way. It seems to me that null would be useful as a legal value in any case.

@jkimbo
Copy link
Member

jkimbo commented May 30, 2018

@altaurog graphene is powered by graphql-core which is an almost direct port of the graphql-js library for node. graphql-core doesn't support null yet but there is an open issue (graphql-python/graphql-core#118) and a potential pull request open (graphql-python/graphql-core#172) for it.

I'm going to close this issue in favour of tracking progress in the graphql-core repo.

@jkimbo jkimbo closed this as completed May 30, 2018
@altaurog
Copy link
Author

@jkimbo thanks! I’ll have a look there.

@antwan
Copy link

antwan commented Jul 1, 2020

Aforementioned issues have been removed. Is it truly fixed?

@jkimbo
Copy link
Member

jkimbo commented Jul 5, 2020

@antwan Graphene v3 uses the new v3 version of graphql-core which has full support for nulls. We’re hoping to release the new version soon but in the meantime there is a beta version that you could use.

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