Skip to content

Commit

Permalink
fix: fix offchain spaces loading using wrong graphql queries
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed May 29, 2024
1 parent ffb185d commit 87ecbca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apps/ui/src/networks/offchain/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@ export function createApi(uri: string, networkId: NetworkID): NetworkApi {
const { data } = await apollo.query({
query: SPACES_RANKING_QUERY,
variables: {
first: Math.min(limit, 20),
first: limit,
skip,
where: {
...filter
}
}
});

return data.ranking.items.map(space => formatSpace(space, networkId));
return data.spaces.map(space => formatSpace(space, networkId));
},
loadSpace: async (id: string): Promise<Space | null> => {
const { data } = await apollo.query({
Expand Down
8 changes: 3 additions & 5 deletions apps/ui/src/networks/offchain/api/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,9 @@ export const PROPOSALS_QUERY = gql`
`;

export const SPACES_RANKING_QUERY = gql`
query ($first: Int, $skip: Int, $where: RankingWhere) {
ranking(first: $first, skip: $skip, where: $where) {
items {
...offchainSpaceFragment
}
query ($first: Int, $skip: Int, $where: SpaceWhere) {
spaces(first: $first, skip: $skip, where: $where) {
...offchainSpaceFragment
}
}
${SPACE_FRAGMENT}
Expand Down

0 comments on commit 87ecbca

Please sign in to comment.