From 2eb039bb3245e42123c4eda1447cc35daf47ff26 Mon Sep 17 00:00:00 2001 From: Juanma Hidalgo Date: Fri, 11 Oct 2024 15:14:13 +0200 Subject: [PATCH] feat: use enums instead of strings in graphql queries (#1607) --- .../decentraland-wearable-rarity/index.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/strategies/decentraland-wearable-rarity/index.ts b/src/strategies/decentraland-wearable-rarity/index.ts index ce800ea82..846f7bceb 100644 --- a/src/strategies/decentraland-wearable-rarity/index.ts +++ b/src/strategies/decentraland-wearable-rarity/index.ts @@ -1,3 +1,4 @@ +import { EnumType } from 'json-to-graphql-query'; import { getAddress } from '@ethersproject/address'; import { subgraphRequest } from '../../utils'; @@ -53,16 +54,16 @@ export async function strategy( __args: { where: { itemType_in: [ - 'wearable_v1', - 'wearable_v2', - 'smart_wearable_v1', - 'emote_v1' + new EnumType('wearable_v1'), + new EnumType('wearable_v2'), + new EnumType('smart_wearable_v1'), + new EnumType('emote_v1') ], owner_in: chunk.map((address) => address.toLowerCase()), id_gt: '' }, - orderBy: 'id', - orderDirection: 'asc', + orderBy: new EnumType('id'), + orderDirection: new EnumType('asc'), first: 1000 }, id: true,