From ba60af68207d6eab3647cba7cc22d05246a55a54 Mon Sep 17 00:00:00 2001 From: David Sutherland Date: Wed, 18 Sep 2019 16:09:32 +1200 Subject: [PATCH] Camel or Snake key --- cylc/flow/network/resolvers.py | 3 ++- cylc/flow/network/schema.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cylc/flow/network/resolvers.py b/cylc/flow/network/resolvers.py index 1fb43e52d82..a6f4982f0a9 100644 --- a/cylc/flow/network/resolvers.py +++ b/cylc/flow/network/resolvers.py @@ -18,6 +18,7 @@ from operator import attrgetter from fnmatch import fnmatchcase +from graphene.utils.str_converters import to_snake_case from cylc.flow.ws_data_mgr import ( ID_DELIM, EDGES, FAMILY_PROXIES, TASK_PROXIES, WORKFLOW) @@ -145,7 +146,7 @@ def sort_elements(elements, args): if sort_args and elements: sort_keys = [ key - for key in sort_args.keys + for key in [to_snake_case(k) for k in sort_args.keys] if hasattr(elements[0], key) ] if sort_keys: diff --git a/cylc/flow/network/schema.py b/cylc/flow/network/schema.py index 00f85d91219..0d9b9bb2e52 100644 --- a/cylc/flow/network/schema.py +++ b/cylc/flow/network/schema.py @@ -143,7 +143,7 @@ def parse_node_id(item, node_type=None): # Field args (i.e. for queries etc): class SortArgs(InputObjectType): keys = List(String, default_value=['id']) - reverse = Boolean() + reverse = Boolean(default_value=False) jobs_args = dict(