You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,20 +78,26 @@ export function getMarketplaceName(marketplace: Marketplace): string {
78
78
## Best Practices for Using Enums
79
79
80
80
-**Consistent Naming:** Use clear, descriptive names for enum values to improve readability.
81
-
-**Centralized Management:** Keep enums in a single file for easier updates and management.
82
-
-**Documentation:** Add comments to enum definitions for better context.
81
+
-**Centralized Management:** Keep enums in a single file for consistency. This makes enums easier to update and ensures they are the single source of truth.
82
+
-**Documentation:** Add comments to enum to clarify their purpose and usage.
83
83
84
-
## Sample Queries
84
+
## Using Enums in Queries
85
85
86
-
### Query 1: Account With The Highest NFT Marketplace Interactions
86
+
Enums in queries help you improve data quality and make your results easier to interpret. They function as filters and response elements, ensuring consistency and reducing errors in marketplace values.
87
87
88
-
The goal of this query is to:
88
+
**Specifics**
89
89
90
-
- Find the account that has interacted with the most unique marketplaces
91
-
- Obtain detailed information about the marketplace interactions
92
-
- Determine total spending amount and NFT transactions
90
+
-**Filtering with Enums:** Enums provide clear filters, allowing you to confidently include or exclude specific marketplaces.
91
+
-**Enums in Responses:** Enums guarantee that only recognized marketplace names are returned, making the results standardized and accurate.
93
92
94
-
This query can be valuable for assessing an account's activity and involvement in the NFT marketplace ecosystem.
93
+
### Sample Queries
94
+
95
+
#### Query 1: Account With The Highest NFT Marketplace Interactions
96
+
97
+
This query does the following:
98
+
99
+
- It finds the account with the highest unique NFT marketplace interactions, which is great for analyzing cross-marketplace activity.
100
+
- The marketplaces field uses the marketplace enum, ensuring consistent and validated marketplace values in the response.
95
101
96
102
```gql
97
103
{
@@ -102,25 +108,15 @@ This query can be valuable for assessing an account's activity and involvement i
102
108
totalSpent
103
109
uniqueMarketplacesCount
104
110
marketplaces {
105
-
marketplace
106
-
}
107
-
sent(first: 5) {
108
-
...id
109
-
tokenId
110
-
value
111
-
txHash
112
-
}
113
-
received(first: 5) {
114
-
id
115
-
tokenId
116
-
value
117
-
txHash
111
+
marketplace # This field returns the enum value representing the marketplace
118
112
}
119
113
}
120
114
}
121
115
```
122
116
123
-
### Return
117
+
#### Returns
118
+
119
+
This response provides account details and a list of unique marketplace interactions with enum values for standardized clarity:
124
120
125
121
```gql
126
122
{
@@ -129,8 +125,8 @@ This query can be valuable for assessing an account's activity and involvement i
### Query 2: Accounts That Engaged with the Most Unique Marketplaces
160
+
####Query 2: Most Active Marketplace for CryptoCoven transactions
229
161
230
-
This query retrieves the top 5 accounts that have interacted with the most unique marketplaces. The marketplace field retrieves a list of interactions for each account.
162
+
This query does the following:
231
163
232
-
```graphql
164
+
- It identifies the marketplace with the highest volume of CryptoCoven transactions.
165
+
- It uses the marketplace enum to ensure that only valid marketplace types appear in the response, adding reliability and consistency to your data.
0 commit comments