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

graphene/graphql-core v3 upgrade #6478

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dwsutherland
Copy link
Member

@dwsutherland dwsutherland commented Nov 14, 2024

partially addresses cylc/cylc-uiserver#333

This is the first part described here:
cylc/cylc-uiserver#333 (comment)

The second, and arguably trickier, part will be the sibling at the UIS.

There were some breaking changes to contend with (mainly around more support for Enums):
https://github.com/graphql-python/graphene/wiki/v3-release-notes

But the most involved part was re-implementing the null stripping, but some time reading the graphql-core I found some tools to help, simplifying the code.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests altered and added to cover.
  • Changelog entry included if this is a change that can affect users

@dwsutherland dwsutherland added dependencies schema change Change to the Cylc GraphQL schema labels Nov 14, 2024
@dwsutherland dwsutherland added this to the 8.x milestone Nov 14, 2024
@dwsutherland dwsutherland self-assigned this Nov 14, 2024
@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 2 times, most recently from 6258587 to 234a4df Compare November 14, 2024 07:50
@dwsutherland dwsutherland added the Breaking Breaking change label Nov 14, 2024
@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 2 times, most recently from b4ee741 to dc47ded Compare November 14, 2024 08:10
@dwsutherland
Copy link
Member Author

dwsutherland commented Nov 14, 2024

Another change I've found is with default_value with mutation arguments (or arguments in general)..
In v3 this value isn't used unless the argument is absent.. So setting it to None/null in the request doc is honored, whereas previously it would have used the argument default_value defined in the schema,
i.e.
This will set mode: Clean as expected:

mutation {
  stop(
      workflows: ["foo/run1"]
    ) {
    result
  }
}"

whereas this will not:

mutation {
  stop(
      workflows: ["foo/run1"],
      mode: None
    ) {
    result
  }
}"

you'll get an error, the None/null is now carried.

And we have a lot of scripts that set args to None in the options.. Slowly working through them.. They'll need to be a valid default in the options.

@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 3 times, most recently from b4c0a46 to 990d9dc Compare November 14, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Breaking change dependencies schema change Change to the Cylc GraphQL schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant