getGatingGroupsAndRules

This query to returns the array of gating groups with rules with filter-sort against the organisations.

Sample query

query getGatingGroupsAndRules($orgId: UUID1!, $limit: Int!, $page: Int!, $status: GatingGroupStatus, $sortBy: gatingGroupSort) {
  getGatingGroupsAndRules(
    orgId: $orgId
    limit: $limit
    page: $page
    status: $status
    sortBy: $sortBy
  ) {
    totalCount
    groups {
      id
      groupName
      description
      status
      tokenGateType
      networkID
      organizationID
      createdAt
      rules {
        id
        gatingGroupId
        ruleType
        isNegativeGating
        isEligibleApproval
      	approvalStatus
        rules {
          ... on ContractAddressGatingRes {
            contractAddress
          }
          ... on ContractAddressWithTokenIDGatingRes {
            contractAddress
            tokenID
          }
          ... on MetaDataGatingRes {
            metaData {
              key
              value
            }
          }
          ... on ContractAddressWithMetaDataGatingRes {
            contractAddress
            metaData {
              key
              value
            }
          }
          ... on ContractAddressWithTokenIDAndMetaDataGatingRes {
            contractAddress
            tokenID
            metaData {
              key
              value
            }
          }
          ... on OnchainGatingRes {
            onchain
          }
        }
        gatingWebhook {
          webhookContract {
            marketplaceCollectionItemId
            contractAddress
            onchainContractType
          }
        }
      }
    }
  }
}

Sample variable

{
  "orgId": "5a198d09-e243-491f-991a-f79e1cecdcc3",
  "limit": 2,
  "page": 1,
  "status": "Active",
  "sortBy": {
    "column": "Date",
    "type": "DESC"
  }
}

Sample response

{
  "data": {
    "getGatingGroupsAndRules": {
      "totalCount": 10,
      "groups": [
        {
          "id": "8884306e-e6d1-437a-826e-035ec7e2d4ed",
          "groupName": "TESTTT GATING RULE",
          "description": "TESTTT",
          "status": "Active",
          "networkID": "b260424b-bb37-4a3e-86d0-0866175e5e68",
          "organizationID": "5a198d09-e243-491f-991a-f79e1cecdcc3",
          "createdAt": "2024-01-18T15:39:59.785332+05:30",
          "tokenGateType": "API",
          "rules": [
            {
              "id": "9638cb9a-c640-4c79-beba-f966782c77af",
              "gatingGroupId": "8884306e-e6d1-437a-826e-035ec7e2d4ed",
              "ruleType": "ContractAddressWithTokenIDAndMetaData",
              "isNegativeGating": true,
              "isEligibleApproval": false,
          		"approvalStatus": "",
              "rules": {
                "contractAddress": "0xb00bde6257cb5fe75526540a39ead91012c44a80",
                "tokenID": 1,
                "metaData": [
                  {
                    "key": "title",
                    "value": "tokenName"
                  },
                  {
                    "key": "description",
                    "value": "token description"
                  }
                ]
              },
              "gatingWebhook": null
            },
            {
              "id": "09e86db0-9dec-4663-8c24-092883be4dea",
              "gatingGroupId": "8884306e-e6d1-437a-826e-035ec7e2d4ed",
              "ruleType": "ContractAddress",
              "isNegativeGating": false,
              "isEligibleApproval": false,
         			 "approvalStatus": "",
              "rules": {
                "contractAddress": "0x8924def9bee0f61e010a7b7c39c4723e6e097383"
              },
              "gatingWebhook": null
            },
            {
              "id": "af8214b2-bfea-467a-b477-6083ad18bb7c",
              "gatingGroupId": "8884306e-e6d1-437a-826e-035ec7e2d4ed",
              "ruleType": "ContractAddressWithTokenID",
              "isNegativeGating": false,
               "isEligibleApproval": false,
         			 "approvalStatus": "",
              "rules": {
                "contractAddress": "0x40d30dedfae0a66cf51f10b04036411d6f65fac6",
                "tokenID": 1
              },
              "gatingWebhook": null
            },
            {
              "id": "d47e2919-7ee1-4215-907d-f448aa4c1913",
              "gatingGroupId": "8884306e-e6d1-437a-826e-035ec7e2d4ed",
              "ruleType": "ContractAddressWithMetaData",
              "isNegativeGating": false,
               "isEligibleApproval": false,
         			 "approvalStatus": "",
              "rules": {
                "contractAddress": "0xab8860756e7e8995e7945d455058f71a9544c83d",
                "metaData": [
                  {
                    "key": "trait_type",
                    "value": "color"
                  },
                  {
                    "key": "value",
                    "value": "red"
                  }
                ]
              },
              "gatingWebhook": null
            },
            {
              "id": "1c23e49f-e202-404b-ad22-07b0975b7f59",
              "gatingGroupId": "8884306e-e6d1-437a-826e-035ec7e2d4ed",
              "ruleType": "MetaData",
              "isNegativeGating": false,
               "isEligibleApproval": false,
         			 "approvalStatus": "",
              "rules": {
                "metaData": [
                  {
                    "key": "title",
                    "value": "tokenName"
                  },
                  {
                    "key": "description",
                    "value": "token description"
                  }
                ]
              },
              "gatingWebhook": null
            },
            {
              "id": "f9450795-18c0-4cb4-8e10-72db783d16eb",
              "gatingGroupId": "8884306e-e6d1-437a-826e-035ec7e2d4ed",
              "ruleType": "ContractAddress",
              "isNegativeGating": false,
               "isEligibleApproval": false,
         			 "approvalStatus": "",
              "rules": {
                "contractAddress": "0x4530c707F7d3ED86d3A2788dd994703036a17c4d"
              },
              "gatingWebhook": {
                "webhookContract": [
                  {
                    "marketplaceCollectionItemId": null,
                    "contractAddress": "0x0EdB7bBb3538412F99845f619BCb2dCC0A230708",
                    "onchainContractType": "TokenGating"
                  }
                ]
              }
            }
          ]
        },
        {
          "id": "028badf7-ec05-47b6-8b99-dcb3a26d659d",
          "groupName": "TESTTT",
          "description": "TESTTT",
          "status": "Active",
          "networkID": "b260424b-bb37-4a3e-86d0-0866175e5e68",
          "organizationID": "5a198d09-e243-491f-991a-f79e1cecdcc3",
          "createdAt": "2024-01-16T19:47:29.767682+05:30",
          "rules": [
            {
              "id": "ac49c518-7d76-4c74-845d-809086d52eb9",
              "gatingGroupId": "028badf7-ec05-47b6-8b99-dcb3a26d659d",
              "ruleType": "ContractAddress",
              "isNegativeGating": false,
              "rules": {
                "contractAddress": "0x8924def9bee0f61e010a7b7c39c4723e6e097383"
              },
              "gatingWebhook": null
            },
            {
              "id": "0fcc6922-661c-4657-9630-d51ff78286c3",
              "gatingGroupId": "028badf7-ec05-47b6-8b99-dcb3a26d659d",
              "ruleType": "ContractAddressWithTokenID",
              "isNegativeGating": false,
              "rules": {
                "contractAddress": "0x40d30dedfae0a66cf51f10b04036411d6f65fac6",
                "tokenID": 1
              },
              "gatingWebhook": null
            }
          ]
        }
      ]
    }
  }
}

Arguments

if need to filter the group or rule, can pass the group and rule in the force resolver.

NameTypeDescriptionRequired
orgIdUUID1The organization idYes
limitintLimit per pageYes
pageIntPage numberYes
statusEnumfilter by status like Active,InActive,AllNo
sortByObjectSort the list by date and name by ASC and DESCorderNo

Fields

NameTypeDescription
GatingGroupsResObjectContains the all information about gating groups