Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💥 default query paths simplified #5920

Merged
merged 35 commits into from
May 11, 2023
Merged

💥 default query paths simplified #5920

merged 35 commits into from
May 11, 2023

Conversation

vikiival
Copy link
Member

@vikiival vikiival commented May 11, 2023

TL;DR

I expect that every prefix is valid subsquid indexer with kodadot schema
Therefore adding new chain would be much easier.
Also removed all SubQuery functions

  • 💥 default path is /subsquid/general
  • ⚰️ removed subquery queries/collectionByAccountWithTokens.graphql
  • ⚰️ removed subquery queries/collectionById.graphql
  • ⚰️ removed subquery queries/collectionForMint.graphql
  • ⚰️ removed subquery queries/collectionIssuerList.graphql
  • ⚰️ removed subquery queries/collectionListByAccount.graphql
  • ⚰️ removed subquery queries/collectionListWithSearch.graphql
  • ⚰️ removed subquery queries/collectionNftEventListById.graphql
  • ⚰️ removed subquery queries/collectionSeriesList.graphql
  • ⚰️ removed subquery queries/collectionStatsById.graphql
  • ⚰️ removed subquery queries/firstNftByIssuer.graphql
  • ⚰️ removed subquery queries/mintedCollectionListByAccount.graphql
  • ⚰️ removed subquery queries/nftById.graphql
  • ⚰️ removed subquery queries/nftByIdMinimal.graphql
  • ⚰️ removed subquery queries/nftIdListByCollection.graphql
  • ⚰️ removed subquery queries/nftList.graphql
  • ⚰️ removed subquery queries/nftListByAccount.graphql
  • ⚰️ removed subquery queries/nftListByCollection.graphql
  • ⚰️ removed subquery queries/nftListByIssuer.graphql
  • ⚰️ removed subquery queries/nftListByIssuerAndOwner.graphql
  • ⚰️ removed subquery queries/nftListCollected.graphql
  • ⚰️ removed subquery queries/nftListSold.graphql
  • ⚰️ removed subquery queries/nftListWithSearch.graphql
  • ⚰️ removed subquery queries/nftMetaList.graphql
  • ⚰️ removed subquery queries/nftMetaListWithSearch.graphql
  • ⚰️ removed subquery queries/nftSimpleListByAccount.graphql
  • ⚰️ removed subquery queries/nftStatsByIssuer.graphql
  • ⚰️ removed subquery queries/simpleNft.graphql
  • ⚰️ removed subquery queries/unique/collectionCuratedList.graphql
  • ⚰️ removed subquery queries/userStatsByAccount.graphql
  • 🧑‍💻 no more hacking of prefix
  • ⚰️ removed obsolete function
  • 🧑‍💻 no more hacking of prefix

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Before submitting pull request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality

Optional

  • I've tested it at </ksm/collection>
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

Had issue bounty label?

  • Fill up your KSM address: Payout

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

Copilot Summary

🤖 Generated by Copilot at a972cb3

Removed unused GraphQL queries and simplified the client computed property in usePrefix.ts to support dynamic URL prefixes for multiple chains and endpoints.

🤖 Generated by Copilot at a972cb3

client returns
urlPrefix directly now
refactor for spring

@vikiival vikiival requested a review from a team as a code owner May 11, 2023 11:56
@vikiival vikiival requested review from roiLeo and daiagi and removed request for a team May 11, 2023 11:56
@netlify
Copy link

netlify bot commented May 11, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 43aa821
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/645cdfcf2044180008428883
😎 Deploy Preview https://deploy-preview-5920--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@reviewpad
Copy link
Contributor

reviewpad bot commented May 11, 2023

AI-Generated Summary: This pull request includes several changes:

  • The getSupportedClient function was removed from utils/prefix.ts, so there is no longer a function to determine the client based on the prefix.
  • The composables/usePrefix.ts and utils/mixins/prefixMixin.ts files were updated to return urlPrefix.value instead of the previous ternary operator.
  • Several query files were deleted, including collectionByAccountWithTokens.graphql, collectionById.graphql, and collectionForMint.graphql, among others.
  • The utils/queryPathResolver.ts file was updated to return 'subsquid/general/' as the default path, and remove handling for specific prefixes like 'rmrk' or 'bsx'.
  • The utils/uniquery.ts file was updated to simply return the prefix parameter in the correctPrefix function.

@codeclimate
Copy link

codeclimate bot commented May 11, 2023

Code Climate has analyzed commit 43aa821 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@daiagi daiagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@vikiival vikiival merged commit 9cc2dae into main May 11, 2023
@vikiival vikiival deleted the get-default-path branch May 11, 2023 15:24
This was referenced May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large Pull request is large waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove SubQuery queries from code Cleanup SubQuery residuals
4 participants