-
Notifications
You must be signed in to change notification settings - Fork 21
graphql-core v3 upgrade #672
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
Conversation
oliver-sanders
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
03cd6f7 to
f0daa30
Compare
f0daa30 to
ab9150a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
ab9150a to
e93aefa
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
df239fe to
f0f55f4
Compare
f0f55f4 to
a3da137
Compare
ac0589e to
f23ce2b
Compare
|
gdammit. Looks like this works under graphql-core v2 but not v3?! The message sounds like it is complaining about the use of a list as a default value, however, we do the exact same thing with broadcasts just a couple of lines above?! broadcasts = GenericScalar(
ids=graphene.List(
ID,
description=sstrip('''
Node IDs, cycle point and/or-just family/task namespace.
E.g: `["1234/foo", "1234/FAM", "*/FAM"]`
'''),
default_value=[] # OK?
),
resolver=resolve_broadcasts,
description='Any active workflow broadcasts.'
)
pruned = Boolean() # TODO: what is this? write description
n_edge_distance = Int(
description=sstrip('''
The maximum graph distance (n) from an active node
of the data-store graph window.
'''),
)
log_records = graphene.List(
LogRecord,
description=sstrip('''
Scheduler log messages of level WARNING and above.
Warning: This is an incrementally updated field. Each update
contains a list of **new** log messages, not a list of all
messages. It is down to the client to store / preserve previous
records.
'''),
default_value=[], # Not OK?!
) |
|
This seems to do the trick: cylc/cylc-flow#6803 |
|
Integration failure fixed, poking tests... |
I guess default values on arguments are treated different to those on the fields? and but if you make it a immutable type: It doesn't complain 😆 (also However, I think the field default is implicit? (if there is nothing but you ask for the field it will return |
|
I've been trying to get the subscription test working, so far I have got to using: However, I must be doing something wrong.. as it hangs on the maybe I have to do something like: Will have another crack at it next week... |
|
If this is a new test, maybe remove it from this PR and prepare a new PR to add the tests? |
cylc/uiserver/graphql/tornado_ws.py
Outdated
| if op_id is None or connection_context.has_operation(op_id): | ||
| message = self.build_message(op_id, op_type, payload) | ||
| return await connection_context.send(message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a new problem in this PR, but I have figured out why we don't get any visibility of subscription errors anywhere. It's because this function doesn't do anything if the operation ID is not registered in the connection context, which it isn't for a graphql subscription error.
But why doesn't it do anything? As far as I can tell, neither self.build_message nor connection_context.send make use of the iterator registered with the operation ID, so why not just do?
| if op_id is None or connection_context.has_operation(op_id): | |
| message = self.build_message(op_id, op_type, payload) | |
| return await connection_context.send(message) | |
| message = self.build_message(op_id, op_type, payload) | |
| return await connection_context.send(message) |
To test out what I'm talking about, try running the GUI with a typo in the Workflows.vue subscription, or by doing a GraphiQL subscription like
subscription App {
deltas {
id
borked
}
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Ronnie Dutta <[email protected]>
7efc375 to
15183a1
Compare
Yes, will do. |
|
Added a back compat patch for: (justification: #698 (comment)) |
ecdf21d to
136be3e
Compare
MetRonnie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
|
🎉 |
|
🚀 |


closes #333
closes #388
closes #698
Is a sibling to:
cylc/cylc-flow#6478
cylc/cylc-ui#2091
(cylc-flow/cylc-uiserver PR needed to be merged at the same time)
Tests will fail until
cylc-flowend is in.Dependencies on:
graphene-tornado==2.6.*graphql-ws==0.4.4have been removed and/or rewritten as a Cylc port of active projects.
There are some short comings in
graphene==3.4.3with the use of middleware and our bespoke execution context (for null-stripping fields) in subscriptions. So I had to adopt and augment a graphql-core package:https://github.com/graphql-python/graphql-core/blob/v3.2.6/src/graphql/execution/subscribe.py
to our own:
cylc/uiserver/graphql/subscribe.py
The HEAD of
graphql-corehas this remedied, but both that and the a correspondinggraphenewill need to be released.Until then
cylc-flowhasgraphenefixed at3.4.3, as we'll need to update our code with any future release ofgraphene/graphql-core(hopefully dropping this workaround).All aspects appear to be functional:
Check List
CONTRIBUTING.mdand added my name as a Code Contributor.setup.cfg(andconda-environment.ymlif present).