Skip to content

Commit

Permalink
feat: update the query NFTs to work with Subsquid too
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Aug 8, 2024
1 parent 470fe94 commit 69e7fa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ports/items/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ export function getItemsQuery(filters: ItemFilters, isCount = false) {

if (contractAddresses && contractAddresses.length > 0) {
where.push(
`collection_in: [${contractAddresses
`collection_: { id_in: [${contractAddresses
.map((contractAddress) => `"${contractAddress}"`)
.join(',')}]`
.join(',')}]}`
)
}

Expand Down
7 changes: 4 additions & 3 deletions src/ports/nfts/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,17 @@ export function createNFTComponent<T extends { id: string }>(options: {

function getFragmentFetcher(filters: NFTFilters & { caller?: string }) {
return async (isCount?: boolean) => {
const variables = getQueryVariables(filters, getSortByProp)
const query = getFetchQuery(
filters,
variables,
fragmentName,
getFragment,
getExtraVariables,
getExtraWhere,
isCount,
filters.category === NFTCategory.ENS ? await getBannedNames() : []
)
const variables = getQueryVariables(filters, getSortByProp)

const { nfts: fragments } = await subgraph.query<{
nfts: T[]
}>(query, variables)
Expand Down Expand Up @@ -114,7 +115,7 @@ export function createNFTComponent<T extends { id: string }>(options: {
getMarketplaceSubgraphNameChain(getMarketplaceChainId())
)
)
const ids = await client.query<{ id: string }>(
const ids = await client.query<{ id: string; subdomain: string }>(
getFuzzySearchQueryForENS(
schemaName.rows[0].entity_schema,
options.search
Expand Down

0 comments on commit 69e7fa8

Please sign in to comment.