Skip to content

Commit

Permalink
Avoid filtering singular entities using mainnet addresses in demo mode (
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamesh0 authored Oct 5, 2022
1 parent a9c49a4 commit f6e750f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/uni-info-watcher/src/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ export const createResolvers = async (indexer: Indexer, eventWatcher: EventWatch
gqlTotalQueryCount.inc(1);
gqlQueryCount.labels('bundles').inc(1);

return indexer.getEntities(Bundle, block, { id: BUNDLE_ID }, { limit: first });
let where = {};
if (!indexer._isDemo) {
// Filter using address deployed on mainnet if not in demo mode
where = { id: BUNDLE_ID };
}

return indexer.getEntities(Bundle, block, where, { limit: first });
},

burns: async (
Expand Down Expand Up @@ -110,7 +116,13 @@ export const createResolvers = async (indexer: Indexer, eventWatcher: EventWatch
gqlTotalQueryCount.inc(1);
gqlQueryCount.labels('factories').inc(1);

return indexer.getEntities(Factory, block, { id: FACTORY_ADDRESS }, { limit: first });
let where = {};
if (!indexer._isDemo) {
// Filter using address deployed on mainnet if not in demo mode
where = { id: FACTORY_ADDRESS };
}

return indexer.getEntities(Factory, block, where, { limit: first });
},

mints: async (
Expand Down

0 comments on commit f6e750f

Please sign in to comment.