Skip to content

Fix parser type safety for stricter AST types#13

Open
corydolphin wants to merge 1 commit into
fix-tests-to-use-proper-ast-nodefrom
fix-parser-type-safety
Open

Fix parser type safety for stricter AST types#13
corydolphin wants to merge 1 commit into
fix-tests-to-use-proper-ast-nodefrom
fix-parser-type-safety

Conversation

@corydolphin
Copy link
Copy Markdown
Owner

  • Handle token.value being str | None by using or "" fallback
  • Fix parse_variable_definition to not use and for side effects
  • Use properly typed variable in parse_nullability_assertion
  • These fixes prepare for stricter type checking in frozen dataclasses

Thank you for contributing to GraphQL-core!

If your pull-request is non-trivial, adds a feature or contains a non-breaking change, then please, first open an issue to discuss the proposed changes and add a link to that issue.

GraphQL-core tries very hard to stay within the scope of being just a Python port of GraphQL.js.

Any additional feature or incompatible change will be only accepted in rare cases and requires a compelling reason, because they aggravate maintenance and synchronization with the developments in the upstream project. So please discuss such changes upfront in an issue before sending a PR. Maybe there are other ways to solve the problem.

If possible, also add unit tests, or provide runnable example code as part of the accompanying issue, from which unit tests can be derived.

- Handle token.value being str | None by using `or ""` fallback
- Fix parse_variable_definition to not use `and` for side effects
- Use properly typed variable in parse_nullability_assertion
- These fixes prepare for stricter type checking in frozen dataclasses
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

Successfully merging this pull request may close these issues.

1 participant