Skip to content

graphene/graphql-core v3 upgrade #6478

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

Open
wants to merge 9 commits 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

sibling to
cylc/cylc-uiserver#672
cylc/cylc-ui#2091

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.

Note:
There are some incompatibilities (i.e. with Enums) on the first version (3.0.0):
https://github.com/graphql-python/graphene/wiki/v3-release-notes
(and perhaps beyond)

The coverage will be lower due to some items only being used at the UIS (at present).

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 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 4 times, most recently from 990d9dc to 5acb256 Compare November 15, 2024 03:59
@oliver-sanders
Copy link
Member

LGTM 🚀

8.4.0 is hopefully imminent (remove + skip mode), so we're probably aiming for 8.5.0 (cylc-uiserver 1.7.0).

Will need to have a play with the cylc-ui forms to see what the impact of the enum changes are. Hopefully, we can keep cylc-uiserver compatible with older cylc-flow schedulers (perhaps using some back-compat shims in cylc-uiserver if needed).

Another change I've found is with default_value with mutation arguments

Good spot. Will need to make sure the UI does the right thing.

@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 2 times, most recently from e3431c6 to 3c36e56 Compare November 15, 2024 10:59
@dwsutherland
Copy link
Member Author

dwsutherland commented Nov 15, 2024

Just made some more changes; covered more code, fixed a few issues..

Hopefully, we can keep cylc-uiserver compatible with older cylc-flow schedulers

Well, the sync is just protobuf.. And I haven't noticed anything other than those defaults from the GraphQL client end.
It may come down to whether the mutations passed through to the UIS need to change (so far so good)..
Definitely can't be in the same python environment... (haha)

@oliver-sanders
Copy link
Member

Once we merge this, we're committed to releasing the uis/ui components in the same minor release.

Hopefully, we can target 8.5.0, created a milestone to assign this to. Note to reviewers, don't merge into master until 8.4.0 has been released.

@oliver-sanders oliver-sanders modified the milestones: 8.x, 8.5.0 Nov 21, 2024
@hjoliver hjoliver added the BLOCKED This can't happen until something else does label Nov 22, 2024
@hjoliver

This comment was marked as resolved.

@oliver-sanders

This comment was marked as resolved.

@dwsutherland

This comment was marked as resolved.

@dwsutherland dwsutherland force-pushed the graphql-core-v3 branch 2 times, most recently from b0775d4 to 97220c8 Compare December 3, 2024 02:09
@dwsutherland

This comment was marked as resolved.

@wxtim

This comment was marked as resolved.

Copy link
Member

@wxtim wxtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been through the complete list of mutation inheriting functions and played with using them on workflows backward and forward across this change.

Broadcast(Mutation):
SetHoldPoint(Mutation):
Pause(Mutation):
Message(Mutation):
ReleaseHoldPoint(Mutation):
Resume(Mutation):
Reload(Mutation):
SetVerbosity(Mutation):
SetGraphWindowExtent(Mutation):
Stop(Mutation):
ExtTrigger(Mutation):

The only breakage I found is that not using --flow where it is available causes the scheduler to traceback, and ignore the command.

@dwsutherland
Copy link
Member Author

not using --flow where it is available causes the scheduler to traceback, and ignore the command.

@wxtim - Thanks for looking at this, I've put a small patch in so flow now gets set to [] if None..
This will allow such commands to be accepted by the new API/graphql

INFO - Command "broadcast" received.
    broadcast(cycle_points=['1'], mode=put_broadcast, namespaces=['bar'], settings=[{'run
    mode': 'skip'}])
INFO - Broadcast set:
    + [1/bar] run mode=skip
INFO - Command "force_trigger_tasks" received. ID=0d82ed7e-1b85-4ab6-a313-557aab64bd2a
    force_trigger_tasks(flow=[], flow_wait=False, on_resume=False, tasks=['1/bar'])
INFO - [1/bar:waiting(runahead)] => waiting
INFO - Command "force_trigger_tasks" actioned. ID=0d82ed7e-1b85-4ab6-a313-557aab64bd2a
INFO - [1/bar:waiting] => running
INFO - [1/bar/01:running] => succeeded

The problem stems from:
#6478 (comment)

Ideally we'd only use arguments in the mutation (or query/subscription) if we set them to something other than None, and perhaps we can generate the mutations to be like this in the future..

But for now, I'll just plug holes where None isn't handled by the resolver.

@dwsutherland

This comment was marked as resolved.

@oliver-sanders

This comment was marked as resolved.

@oliver-sanders

This comment was marked as resolved.

@dwsutherland

This comment was marked as resolved.

@oliver-sanders

This comment was marked as resolved.

@dwsutherland dwsutherland removed the schema change Change to the Cylc GraphQL schema label Mar 31, 2025
@oliver-sanders
Copy link
Member

oliver-sanders commented Apr 3, 2025

I used to the GraphQL introspection query to extract the GraphQL schema before and after this PR to see what's changed.

Here are the results
--- before	2025-04-03 13:17:23.610147000 +0100
+++ after	2025-04-03 13:17:58.111147000 +0100
@@ -216,38 +216,10 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "tasks",
-                  "description": "Deprecated, use ids: [\"*/<task>\"].",
-                  "type": {
-                    "kind": "LIST",
-                    "name": null,
-                    "ofType": {
-                      "kind": "SCALAR",
-                      "name": "ID",
-                      "ofType": null
-                    }
-                  },
-                  "defaultValue": "[]"
-                },
-                {
-                  "name": "states",
-                  "description": null,
-                  "type": {
-                    "kind": "LIST",
-                    "name": null,
-                    "ofType": {
-                      "kind": "SCALAR",
-                      "name": "ID",
-                      "ofType": null
-                    }
-                  },
-                  "defaultValue": "[]"
-                },
-                {
-                  "name": "exstates",
                   "description": null,
                   "type": {
                     "kind": "LIST",
@@ -418,7 +390,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 }
               ],
               "type": {
@@ -626,7 +598,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -776,7 +748,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -994,7 +966,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -1059,7 +1031,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -1240,7 +1212,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -1455,7 +1427,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -1560,7 +1532,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -1733,7 +1705,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -1906,7 +1878,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -2019,7 +1991,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -2132,7 +2104,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -2301,7 +2273,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -2677,7 +2649,7 @@
         {
           "kind": "SCALAR",
           "name": "Int",
-          "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31 - 1) and 2^31 - 1 since represented in JSON as double-precision floating point numbers specifiedby [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).",
+          "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",
           "fields": null,
           "inputFields": null,
           "interfaces": null,
@@ -2889,7 +2861,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -2994,7 +2966,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -3497,7 +3469,7 @@
         {
           "kind": "SCALAR",
           "name": "Float",
-          "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ",
+          "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",
           "fields": null,
           "inputFields": null,
           "interfaces": null,
@@ -3736,7 +3708,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "sortOrder",
@@ -3797,7 +3769,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "sortOrder",
@@ -3858,7 +3830,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "sortOrder",
@@ -4003,7 +3975,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -4176,7 +4148,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -4349,7 +4321,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -4518,7 +4490,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -5523,7 +5495,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -5696,7 +5668,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -5869,7 +5841,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -6038,7 +6010,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -6282,7 +6254,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -6387,7 +6359,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -6492,7 +6464,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -6597,7 +6569,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -6780,7 +6752,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -7709,7 +7681,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -7814,7 +7786,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -8212,7 +8184,7 @@
                       "ofType": null
                     }
                   },
-                  "defaultValue": "\"Set\""
+                  "defaultValue": "Set"
                 },
                 {
                   "name": "namespaces",
@@ -8340,7 +8312,7 @@
                     "name": "String",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "messages",
@@ -8358,7 +8330,7 @@
                       }
                     }
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "taskJob",
@@ -8626,7 +8598,7 @@
                     "name": "WorkflowStopMode",
                     "ofType": null
                   },
-                  "defaultValue": "\"Clean\""
+                  "defaultValue": "Clean"
                 },
                 {
                   "name": "task",
@@ -9312,7 +9284,7 @@
                     "name": "WorkflowRunMode",
                     "ofType": null
                   },
-                  "defaultValue": "\"Live\""
+                  "defaultValue": "Live"
                 },
                 {
                   "name": "noTimestamp",
@@ -10171,20 +10143,20 @@
           "interfaces": null,
           "enumValues": [
             {
-              "name": "Simulation",
-              "description": "Simulates job submission with configurable exection time and succeeded/failed outcomes (but does not submit real jobs).",
+              "name": "Live",
+              "description": "Task will submit their configured jobs.",
               "isDeprecated": false,
               "deprecationReason": null
             },
             {
-              "name": "Dummy",
-              "description": "Submits real jobs with empty scripts.",
+              "name": "Simulation",
+              "description": "Simulates job submission with configurable exection time and succeeded/failed outcomes (but does not submit real jobs).",
               "isDeprecated": false,
               "deprecationReason": null
             },
             {
-              "name": "Live",
-              "description": "Task will submit their configured jobs.",
+              "name": "Dummy",
+              "description": "Submits real jobs with empty scripts.",
               "isDeprecated": false,
               "deprecationReason": null
             }
@@ -10567,7 +10539,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -10797,7 +10769,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -11095,7 +11067,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -11325,7 +11297,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -11623,7 +11595,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -11728,7 +11700,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -11949,7 +11921,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -12222,7 +12194,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -12395,7 +12367,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -12508,7 +12480,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -12613,7 +12585,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -12786,7 +12758,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -12899,7 +12871,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -13064,7 +13036,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -13237,7 +13209,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -13350,7 +13322,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -13455,7 +13427,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -13628,7 +13600,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -13741,7 +13713,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -13831,7 +13803,7 @@
             }
           ],
           "inputFields": null,
-          "interfaces": null,
+          "interfaces": [],
           "enumValues": null,
           "possibleTypes": [
             {
@@ -13911,7 +13883,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -14084,7 +14056,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -14197,7 +14169,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -14302,7 +14274,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -14475,7 +14447,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -14588,7 +14560,7 @@
                     "name": "SortArgs",
                     "ofType": null
                   },
-                  "defaultValue": null
+                  "defaultValue": "null"
                 },
                 {
                   "name": "stripNull",
@@ -14873,9 +14845,21 @@
         {
           "kind": "OBJECT",
           "name": "__Schema",
-          "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation and subscription operations.",
+          "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",
           "fields": [
             {
+              "name": "description",
+              "description": null,
+              "args": [],
+              "type": {
+                "kind": "SCALAR",
+                "name": "String",
+                "ofType": null
+              },
+              "isDeprecated": false,
+              "deprecationReason": null
+            },
+            {
               "name": "types",
               "description": "A list of all types supported by this server.",
               "args": [],
@@ -14972,7 +14956,7 @@
         {
           "kind": "OBJECT",
           "name": "__Type",
-          "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",
+          "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",
           "fields": [
             {
               "name": "kind",
@@ -15015,6 +14999,18 @@
               "deprecationReason": null
             },
             {
+              "name": "specifiedByURL",
+              "description": null,
+              "args": [],
+              "type": {
+                "kind": "SCALAR",
+                "name": "String",
+                "ofType": null
+              },
+              "isDeprecated": false,
+              "deprecationReason": null
+            },
+            {
               "name": "fields",
               "description": null,
               "args": [
@@ -15119,7 +15115,18 @@
             {
               "name": "inputFields",
               "description": null,
-              "args": [],
+              "args": [
+                {
+                  "name": "includeDeprecated",
+                  "description": null,
+                  "type": {
+                    "kind": "SCALAR",
+                    "name": "Boolean",
+                    "ofType": null
+                  },
+                  "defaultValue": "false"
+                }
+              ],
               "type": {
                 "kind": "LIST",
                 "name": null,
@@ -15157,7 +15164,7 @@
         {
           "kind": "ENUM",
           "name": "__TypeKind",
-          "description": "An enum describing what kind of type a given `__Type` is",
+          "description": "An enum describing what kind of type a given `__Type` is.",
           "fields": null,
           "inputFields": null,
           "interfaces": null,
@@ -15176,7 +15183,7 @@
             },
             {
               "name": "INTERFACE",
-              "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.",
+              "description": "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.",
               "isDeprecated": false,
               "deprecationReason": null
             },
@@ -15249,7 +15256,18 @@
             {
               "name": "args",
               "description": null,
-              "args": [],
+              "args": [
+                {
+                  "name": "includeDeprecated",
+                  "description": null,
+                  "type": {
+                    "kind": "SCALAR",
+                    "name": "Boolean",
+                    "ofType": null
+                  },
+                  "defaultValue": "false"
+                }
+              ],
               "type": {
                 "kind": "NON_NULL",
                 "name": null,
@@ -15371,6 +15389,34 @@
             },
             {
               "name": "defaultValue",
+              "description": "A GraphQL-formatted string representing the default value for this input value.",
+              "args": [],
+              "type": {
+                "kind": "SCALAR",
+                "name": "String",
+                "ofType": null
+              },
+              "isDeprecated": false,
+              "deprecationReason": null
+            },
+            {
+              "name": "isDeprecated",
+              "description": null,
+              "args": [],
+              "type": {
+                "kind": "NON_NULL",
+                "name": null,
+                "ofType": {
+                  "kind": "SCALAR",
+                  "name": "Boolean",
+                  "ofType": null
+                }
+              },
+              "isDeprecated": false,
+              "deprecationReason": null
+            },
+            {
+              "name": "deprecationReason",
               "description": null,
               "args": [],
               "type": {
@@ -15488,6 +15534,22 @@
               "deprecationReason": null
             },
             {
+              "name": "isRepeatable",
+              "description": null,
+              "args": [],
+              "type": {
+                "kind": "NON_NULL",
+                "name": null,
+                "ofType": {
+                  "kind": "SCALAR",
+                  "name": "Boolean",
+                  "ofType": null
+                }
+              },
+              "isDeprecated": false,
+              "deprecationReason": null
+            },
+            {
               "name": "locations",
               "description": null,
               "args": [],
@@ -15514,7 +15576,18 @@
             {
               "name": "args",
               "description": null,
-              "args": [],
+              "args": [
+                {
+                  "name": "includeDeprecated",
+                  "description": null,
+                  "type": {
+                    "kind": "SCALAR",
+                    "name": "Boolean",
+                    "ofType": null
+                  },
+                  "defaultValue": "false"
+                }
+              ],
               "type": {
                 "kind": "NON_NULL",
                 "name": null,
@@ -15534,54 +15607,6 @@
               },
               "isDeprecated": false,
               "deprecationReason": null
-            },
-            {
-              "name": "onOperation",
-              "description": null,
-              "args": [],
-              "type": {
-                "kind": "NON_NULL",
-                "name": null,
-                "ofType": {
-                  "kind": "SCALAR",
-                  "name": "Boolean",
-                  "ofType": null
-                }
-              },
-              "isDeprecated": true,
-              "deprecationReason": "Use `locations`."
-            },
-            {
-              "name": "onFragment",
-              "description": null,
-              "args": [],
-              "type": {
-                "kind": "NON_NULL",
-                "name": null,
-                "ofType": {
-                  "kind": "SCALAR",
-                  "name": "Boolean",
-                  "ofType": null
-                }
-              },
-              "isDeprecated": true,
-              "deprecationReason": "Use `locations`."
-            },
-            {
-              "name": "onField",
-              "description": null,
-              "args": [],
-              "type": {
-                "kind": "NON_NULL",
-                "name": null,
-                "ofType": {
-                  "kind": "SCALAR",
-                  "name": "Boolean",
-                  "ofType": null
-                }
-              },
-              "isDeprecated": true,
-              "deprecationReason": "Use `locations`."
             }
           ],
           "inputFields": null,
@@ -15640,6 +15665,12 @@
               "deprecationReason": null
             },
             {
+              "name": "VARIABLE_DEFINITION",
+              "description": "Location adjacent to a variable definition.",
+              "isDeprecated": false,
+              "deprecationReason": null
+            },
+            {
               "name": "SCHEMA",
               "description": "Location adjacent to a schema definition.",
               "isDeprecated": false,
@@ -15653,7 +15684,7 @@
             },
             {
               "name": "OBJECT",
-              "description": "Location adjacent to an object definition.",
+              "description": "Location adjacent to an object type definition.",
               "isDeprecated": false,
               "deprecationReason": null
             },
@@ -15695,7 +15726,7 @@
             },
             {
               "name": "INPUT_OBJECT",
-              "description": "Location adjacent to an input object definition.",
+              "description": "Location adjacent to an input object type definition.",
               "isDeprecated": false,
               "deprecationReason": null
             },
@@ -15756,6 +15787,51 @@
                   "ofType": null
                 }
               },
+              "defaultValue": null
+            }
+          ]
+        },
+        {
+          "name": "deprecated",
+          "description": "Marks an element of a GraphQL schema as no longer supported.",
+          "locations": [
+            "FIELD_DEFINITION",
+            "ARGUMENT_DEFINITION",
+            "INPUT_FIELD_DEFINITION",
+            "ENUM_VALUE"
+          ],
+          "args": [
+            {
+              "name": "reason",
+              "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",
+              "type": {
+                "kind": "SCALAR",
+                "name": "String",
+                "ofType": null
+              },
+              "defaultValue": "\"No longer supported\""
+            }
+          ]
+        },
+        {
+          "name": "specifiedBy",
+          "description": "Exposes a URL that specifies the behavior of this scalar.",
+          "locations": [
+            "SCALAR"
+          ],
+          "args": [
+            {
+              "name": "url",
+              "description": "The URL that specifies the behavior of this scalar.",
+              "type": {
+                "kind": "NON_NULL",
+                "name": null,
+                "ofType": {
+                  "kind": "SCALAR",
+                  "name": "String",
+                  "ofType": null
+                }
+              },
               "defaultValue": null
             }
           ]

Itemised changes:

  1. defaultValue = null has changed to defaultValue = "null".
    • As identified in the OP.
    • I don't actually understand this change.
    • It's not consistent! E.g, the isRunahead field has defaultValue: null whereas SortArgs has defaultValue: "null"?!
    • Why is one quoted and the other not?
    • Is this just different behaviour for fields / inputs?
  2. "tasks" and "states" arguments, not related to this PR (change in cylc UIS).
    • No problem.
  3. Minor changes to description fields (ala graphql-core update).
    • No problem.
  4. Change in order of Enum keys.
    • No problem.
  5. Change in Enum default value syntax.
    • Minor issue, can be worked around.
    • This seems to be the opposite of the "null" change though which makes me wonder if we're setting default values right?
  6. New GraphQL types (ala graphql-core update).
    • No problem.
      0

@dwsutherland
Copy link
Member Author

dwsutherland commented Apr 4, 2025

I don't actually understand this change.

Neither do I .. "null" is weird ..
It makes sense for the enum, because you're dump is JSON so "Live" is correct if it's now Live in the query document..
But it's a little weird the null will be dumped to "null", maybe this is a bug in Graphene/GraphQL? where they should be JSON dumping None and not null in python? (because None will get turned into null not "null")

We could try specify a default for these arguments where we get "null"? ..
I don't think we changed... But it could be something to do with the how arguments can no longer be null, they need to be set as a legitimate value or not included... (?)

@wxtim

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants