From 39ec9a2e31a196c971e4e86b766e59a8031a84ad Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 16 Jan 2024 23:40:42 +0000 Subject: [PATCH] Fix GQL QueryLink (#45) Reviewed-on: https://git.vdb.to/cerc-io/laconic-console/pulls/45 Co-authored-by: Thomas E Lackey Co-committed-by: Thomas E Lackey --- package.json | 2 +- src/components/QueryLink.js | 47 +++++++++++++++++++++++++++++++------ 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index a218877..104f880 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cerc-io/console-app", - "version": "1.3.6", + "version": "1.3.7", "description": "Laconic Console", "repository": "https://github.com/cerc-io/laconic-console", "main": "dist/es/index.js", diff --git a/src/components/QueryLink.js b/src/components/QueryLink.js index 38e264d..b94036b 100644 --- a/src/components/QueryLink.js +++ b/src/components/QueryLink.js @@ -10,8 +10,41 @@ import LinkIcon from '@material-ui/icons/ExitToApp'; import { getServiceUrl } from '../util/config'; const QUERY = ` - query { - getRecordsByIds(ids: [ "%ID%" ]) { + fragment ValueParts on Value { + ... on BooleanValue { + bool: value + } + ... on IntValue { + int: value + } + ... on FloatValue { + float: value + } + ... on StringValue { + string: value + } + ... on BytesValue { + bytes: value + } + ... on LinkValue { + link: value + } + } + + fragment AttrParts on Attribute { + key + value { + ...ValueParts + ... on ArrayValue { + value { + ...ValueParts + } + } + } + } + + { + getRecordsByIds(ids: ["%ID%"]) { id names bondId @@ -19,12 +52,12 @@ const QUERY = ` expiryTime owners attributes { - key + ...AttrParts value { - string - json - reference { - id + ... on MapValue { + map: value { + ...AttrParts + } } } }