Skip to content

Commit

Permalink
fix: use date instead of block to filter
Browse files Browse the repository at this point in the history
  • Loading branch information
kilted-andres committed Aug 6, 2024
1 parent 2abf449 commit bbfdee0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utilities/indexer/queryCTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function queryCTypes() {
},
});

const fromBlock = latestCType ? Number(latestCType.dataValues.block) : 0;
const fromDate = latestCType ? latestCType.dataValues.createdAt : new Date(0);

// When modifying this query, first try it out on the https://indexer.kilt.io/ (or dev-indexer) and click on "Prettify"
// const writtenQuery = `
Expand Down Expand Up @@ -64,7 +64,7 @@ export async function queryCTypes() {
const queryParams = {
entity: 'cTypes',
fields: fieldsToQuery,
filter: `{ registrationBlock: { id: { greaterThan: "${fromBlock}" } } }`,
filter: `{ registrationBlock: { timeStamp: { greaterThan: "${fromDate.toISOString()}" } } }`,
fragments: [wholeBlock, DidNames],
};

Expand Down

0 comments on commit bbfdee0

Please sign in to comment.