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

Consider renaming INVALID to Undefined #77

Closed
Cito opened this issue Jan 29, 2020 · 3 comments
Closed

Consider renaming INVALID to Undefined #77

Cito opened this issue Jan 29, 2020 · 3 comments

Comments

@Cito
Copy link
Member

Cito commented Jan 29, 2020

GraphQL-Core-Next introduced the INVALID singleton to specify invalid and undefined values in places where GraphQL.js uses the global undefined which is only available in JavaScript. GraphQL-Core later introduced Undefined for the same purpose.

I'm inclined to use the same name Undefined in GraphQL-Core-Next, in order to maintain better backward compatibility with v2, and because it is more similar to GraphQL.js and maye more Python, since the None singleton, and False and True are also spelled as a capitalized words in Python. I would keep INVALID as an alias for backward compatibility with previous releases of v3.

@jkimbo
Copy link
Member

jkimbo commented Jan 29, 2020

+1 to this change. It makes sense to keep the naming similar to the reference library.

As an aside if this change happens soon then we could move graphene to use Undefined instead of INVALID before v3 goes out.

@Cito
Copy link
Member Author

Cito commented Jan 29, 2020

If we agree to do this, I could create a patch release in the 3.0.x branch (corresponding to GraphQL.js 14) with Undefined as alias for INVALID so this could be already used in Graphene. In the 3.1.x branch (corresponding to GraphQL.js 15) it will then be the other way around, INVALID will be an alias for Undefined and considered deprecated.

@Cito
Copy link
Member Author

Cito commented Feb 2, 2020

Version 3.0.3 exporting Undefined as a forward compatible alias for INVALID has been released now. In version 3.1, INVALID will be still available, but considered deprecated.

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

2 participants