From ff5d41cfabafb8b1ca48c8b55098827456ca1fa4 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:00:31 +0900 Subject: [PATCH 1/2] fix: fix space query unable to get past 30k spaces --- src/graphql/helpers.ts | 2 +- src/graphql/schema.gql | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/graphql/helpers.ts b/src/graphql/helpers.ts index 3ed6276c..c65cfbca 100644 --- a/src/graphql/helpers.ts +++ b/src/graphql/helpers.ts @@ -154,7 +154,7 @@ export function buildWhereQuery(fields, alias, where) { export async function fetchSpaces(args) { const { first = 20, skip = 0, where = {} } = args; - const fields = { id: 'string' }; + const fields = { id: 'string', created_at: 'number' }; const whereQuery = buildWhereQuery(fields, 's', where); const queryStr = whereQuery.query; const params: any[] = whereQuery.params; diff --git a/src/graphql/schema.gql b/src/graphql/schema.gql index 73ee28c1..fcca6845 100644 --- a/src/graphql/schema.gql +++ b/src/graphql/schema.gql @@ -117,6 +117,12 @@ type Query { input SpaceWhere { id: String id_in: [String] + created_at: Int + created_at_in: [Int] + created_at_gt: Int + created_at_gte: Int + created_at_lt: Int + created_at_lte: Int } input RankingWhere { @@ -385,6 +391,7 @@ type Space { verified: Boolean flagged: Boolean rank: Float + created_at: Int! } type RankingObject { From 3fd4e1b017cc464fd588dca3ee4a8c3f123df5e9 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:08:51 +0800 Subject: [PATCH 2/2] fix: remove `_at` suffix from created property --- src/graphql/helpers.ts | 2 +- src/graphql/schema.gql | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/graphql/helpers.ts b/src/graphql/helpers.ts index 8a44508d..27484750 100644 --- a/src/graphql/helpers.ts +++ b/src/graphql/helpers.ts @@ -154,7 +154,7 @@ export function buildWhereQuery(fields, alias, where) { export async function fetchSpaces(args) { const { first = 20, skip = 0, where = {} } = args; - const fields = { id: 'string', created_at: 'number' }; + const fields = { id: 'string', created: 'number' }; const whereQuery = buildWhereQuery(fields, 's', where); const queryStr = whereQuery.query; const params: any[] = whereQuery.params; diff --git a/src/graphql/schema.gql b/src/graphql/schema.gql index fcca6845..1a1939ac 100644 --- a/src/graphql/schema.gql +++ b/src/graphql/schema.gql @@ -117,12 +117,12 @@ type Query { input SpaceWhere { id: String id_in: [String] - created_at: Int - created_at_in: [Int] - created_at_gt: Int - created_at_gte: Int - created_at_lt: Int - created_at_lte: Int + created: Int + created_in: [Int] + created_gt: Int + created_gte: Int + created_lt: Int + created_lte: Int } input RankingWhere { @@ -391,7 +391,7 @@ type Space { verified: Boolean flagged: Boolean rank: Float - created_at: Int! + created: Int! } type RankingObject {