This query to return the gating group details with rules with filter.
Sample query
query getGatingRules($groupID: UUID1!) {
getGatingRules(groupID: $groupID) {
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
{
"groupID": "8884306e-e6d1-437a-826e-035ec7e2d4ed"
}
Sample response
{
"data": {
"getGatingRules": {
"id": "8884306e-e6d1-437a-826e-035ec7e2d4ed",
"groupName": "TESTTT GATING RULE",
"description": "TESTTT",
"status": "Active",
"tokenGateType":"API",
"networkID": "b260424b-bb37-4a3e-86d0-0866175e5e68",
"organizationID": "5a198d09-e243-491f-991a-f79e1cecdcc3",
"createdAt": "2024-01-18T15:39:59.785332+05:30",
"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"
}
]
}
}
]
}
}
}
Arguments
if a rule filter is needed, need to pass the rule ID in the parameter.
Name | Type | Description |
---|---|---|
groupID | UUID1 | The gating group id |
Fields
Name | Type | Description |
---|---|---|
GatingGroups | Object | Contains information about from GatingGroups such as group name, group id, rules and etc.. |