From 69ba40d75836bc4f76b64d0ad0fceec1b66061a0 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 7 May 2024 19:25:51 +0530 Subject: [PATCH] Add an example GQL query with record filters --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index f0f9f08..27baa6c 100644 --- a/README.md +++ b/README.md @@ -594,3 +594,53 @@ $ laconic registry bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b5 } } ``` + +* Query with filters, for example: query all `filecoin` `WatcherRecord`s: + + ```gql + { + queryRecords ( + attributes: [ + { + key: "type", + value: { + string: "WatcherRecord" + } + }, + { + key: "chain", + value: { + string: "filecoin" + } + } + ], + all: true + ) { + id + bondId + names + attributes { + key + 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 } + ... on ArrayValue { + array: 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 } + } + } + ... on MapValue { map: value { key mapping: value { __typename } } } + } + } + } + } + ```