Select one level deep values for array type attributes from GQL query result #2

Merged
ashwin merged 1 commits from pm-handle-array-fields into ng-rm-record-types 2024-01-11 10:22:37 +00:00
Member
Follows https://git.vdb.to/cerc-io/laconic-sdk/pulls/42
prathamesh added 1 commit 2024-01-11 10:06:33 +00:00
Author
Member

CLI Query result for record having an array type attribute before and after these changes:

Before:

➜  laconic-registry-cli git:(main) ✗ laconic cns record get --id bafyreidatw4ha56f47apihdbayjjn34iamzbgqscdv64oi5tyhoohahg34
[
  {
    "id": "bafyreidatw4ha56f47apihdbayjjn34iamzbgqscdv64oi5tyhoohahg34",
    "names": [
      "crn://uniswap/applications/interface",
      "crn://uniswap/applications/interface@0a09352cb262f90dc9542ad067854779b4c7db0a",
      "crn://uniswap/applications/interface@1.1.0"
    ],
    "owners": [
      "7A9E68F550F7DCFF333528911556B1639BE6FF95"
    ],
    "bondId": "58e3ef3013a1bbd01e198448a8ee5555638bba9a46c72d087306cb33b51c6b8f",
    "createTime": "2024-01-11T08:24:37Z",
    "expiryTime": "2025-01-10T08:24:37Z",
    "attributes": {
      "app_type": "webapp",
      "app_version": "1.1.0",
      "description": "Uniswap Interface",
      "license": "GPL-3.0-or-later",
      "name": "@uniswap/interface",
      "repository": [
        {
          "__typename": "StringValue"
        }
      ],
      "repository_ref": "0a09352cb262f90dc9542ad067854779b4c7db0a",
      "type": "ApplicationRecord",
      "version": "0.0.3"
    }
  }
]

After:

➜  laconic-registry-cli git:(main) ✗ laconic cns record get --id bafyreidatw4ha56f47apihdbayjjn34iamzbgqscdv64oi5tyhoohahg34
[
  {
    "id": "bafyreidatw4ha56f47apihdbayjjn34iamzbgqscdv64oi5tyhoohahg34",
    "names": [
      "crn://uniswap/applications/interface",
      "crn://uniswap/applications/interface@0a09352cb262f90dc9542ad067854779b4c7db0a",
      "crn://uniswap/applications/interface@1.1.0"
    ],
    "owners": [
      "7A9E68F550F7DCFF333528911556B1639BE6FF95"
    ],
    "bondId": "58e3ef3013a1bbd01e198448a8ee5555638bba9a46c72d087306cb33b51c6b8f",
    "createTime": "2024-01-11T08:24:37Z",
    "expiryTime": "2025-01-10T08:24:37Z",
    "attributes": {
      "app_type": "webapp",
      "app_version": "1.1.0",
      "description": "Uniswap Interface",
      "license": "GPL-3.0-or-later",
      "name": "@uniswap/interface",
      "repository": [
        "https://github.com/uniswap/interface"
      ],
      "repository_ref": "0a09352cb262f90dc9542ad067854779b4c7db0a",
      "type": "ApplicationRecord",
      "version": "0.0.3"
    }
  }
]
CLI Query result for record having an array type attribute before and after these changes: Before: ``` ➜ laconic-registry-cli git:(main) ✗ laconic cns record get --id bafyreidatw4ha56f47apihdbayjjn34iamzbgqscdv64oi5tyhoohahg34 [ { "id": "bafyreidatw4ha56f47apihdbayjjn34iamzbgqscdv64oi5tyhoohahg34", "names": [ "crn://uniswap/applications/interface", "crn://uniswap/applications/interface@0a09352cb262f90dc9542ad067854779b4c7db0a", "crn://uniswap/applications/interface@1.1.0" ], "owners": [ "7A9E68F550F7DCFF333528911556B1639BE6FF95" ], "bondId": "58e3ef3013a1bbd01e198448a8ee5555638bba9a46c72d087306cb33b51c6b8f", "createTime": "2024-01-11T08:24:37Z", "expiryTime": "2025-01-10T08:24:37Z", "attributes": { "app_type": "webapp", "app_version": "1.1.0", "description": "Uniswap Interface", "license": "GPL-3.0-or-later", "name": "@uniswap/interface", "repository": [ { "__typename": "StringValue" } ], "repository_ref": "0a09352cb262f90dc9542ad067854779b4c7db0a", "type": "ApplicationRecord", "version": "0.0.3" } } ] ``` After: ``` ➜ laconic-registry-cli git:(main) ✗ laconic cns record get --id bafyreidatw4ha56f47apihdbayjjn34iamzbgqscdv64oi5tyhoohahg34 [ { "id": "bafyreidatw4ha56f47apihdbayjjn34iamzbgqscdv64oi5tyhoohahg34", "names": [ "crn://uniswap/applications/interface", "crn://uniswap/applications/interface@0a09352cb262f90dc9542ad067854779b4c7db0a", "crn://uniswap/applications/interface@1.1.0" ], "owners": [ "7A9E68F550F7DCFF333528911556B1639BE6FF95" ], "bondId": "58e3ef3013a1bbd01e198448a8ee5555638bba9a46c72d087306cb33b51c6b8f", "createTime": "2024-01-11T08:24:37Z", "expiryTime": "2025-01-10T08:24:37Z", "attributes": { "app_type": "webapp", "app_version": "1.1.0", "description": "Uniswap Interface", "license": "GPL-3.0-or-later", "name": "@uniswap/interface", "repository": [ "https://github.com/uniswap/interface" ], "repository_ref": "0a09352cb262f90dc9542ad067854779b4c7db0a", "type": "ApplicationRecord", "version": "0.0.3" } } ] ```
ashwin merged commit e92bf8e431 into ng-rm-record-types 2024-01-11 10:22:37 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: deep-stack/laconic-sdk#2
No description provided.