-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
AST node type annotations vs. GraphQL spec #98
Comments
Good question, @LWprogramming. The simple answer is that GraphQL-core is just a port of GraphQL.js where these are defined as optional in Flow and TypeScript. But the reason for that is not obvious to me either. Generally, the Node types are more relaxed because you want to be able to parse invalid documents, and then let the validator complain about violation of the specs. So the parser would parse However, I think you're right in that the types should never be I have passed on these questions to the GraphQL.js issue tracker now. |
After discussion there, the questions above can be answered as follows:
|
Issue graphql-python/graphql-core#98 fixed in graphql-core 3.1.2
* Implement type/interface/enum/union suppression * Remove out-of-place InputSchemaStrings class * Fix type annotation * Implement error checking to prevent unsupported suppressions * Remove outdated comment * Raise error onuppressing interface implementation * Nits * lint * Reorder functions * Update CascadingSuppressionError message * start lint * Fix lint * typo * Fix mypy errors around GraphQL-core's type-hint * mypy attempted fix with REMOVE set to Ellipsis * Formatting * fix cascading init header * Replace return None with return IDLE * Add missing words * Refactor helper function to return IDLE value when appropriate * Fix comments * Add module docstring * Fix bug with union cascading check * Nits * Update renamings argument description * add missing whitespace * satisfy mypy * Fix docstring paste mistake * Fix wording for cascading error explanation * Correct docstrings for cascading visitor * Add note about superclass error * Clarify file docstring * Fix rename_schema docstring * Remove unnecessary comment * Improve cascading error message * fix comments * typo * Remove unnecessary arg * Refactor to clarify object name * address nits * Update Pipfile to use graphql-core >= 3.1.2 * Narrow type hints with graphql-core update * Remove null check Issue graphql-python/graphql-core#98 fixed in graphql-core 3.1.2 * Update scalar renaming documentation * Indicate suppression along with renaming in comments * Use bullet points in CascadingSuppressionError * Add class docstrings describing error-checking visitor usage * lint * Address comments
Some AST node types, such as the
UnionTypeDefinitionNode
and theEnumTypeDefinitionNode
, have annotations that say their fields/values are optional. For instance,UnionTypeDefinitionNode
has an optional frozenlist for the types that the union contains. However, according to the GraphQL spec, unions have to contain at least one unique member type, so it doesn't seem like the list would ever beNone
. Is there a case that I've missed?The text was updated successfully, but these errors were encountered: