Skip to content

Commit

Permalink
Merge pull request #10197 from kodadot/POC-gql-tada
Browse files Browse the repository at this point in the history
[Maintanence + DX] - delete old queries and POC gql-tada
  • Loading branch information
prury committed May 16, 2024
2 parents 16edcb9 + 4dffbc6 commit 751fb0b
Show file tree
Hide file tree
Showing 104 changed files with 593 additions and 2,294 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,6 @@ sitemap.xml
/test-results/
/playwright-report/
/playwright/.cache/


queries/clients/*.d.ts
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"deno.enable": false,
"deno.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true

}
7 changes: 0 additions & 7 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@
:chain="urlPrefix"
@select="showMobileNavbar" />

<!-- commenting as part of #5889-->
<!-- <StatsDropdown
class="navbar-stats custom-navbar-item"
data-testid="stats"
:is-mobile="isMobile"
:chain="urlPrefix" /> -->

<MobileExpandableSection
v-slot="{ onCloseMobileSubMenu }"
class="lg:!hidden"
Expand Down
14 changes: 0 additions & 14 deletions components/carousel/CarouselTypeSpotlight.vue

This file was deleted.

90 changes: 0 additions & 90 deletions components/carousel/utils/useCarouselSpotlight.ts

This file was deleted.

24 changes: 13 additions & 11 deletions components/collection/CollectionHeader/CollectionBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@ import { sanitizeIpfsUrl, toOriginalContentUrl } from '@/utils/ipfs'
import HeroButtons from '@/components/collection/HeroButtons.vue'
import { generateCollectionImage } from '@/utils/seoImageGenerator'
import { convertMarkdownToText } from '@/utils/markdown'
import collectionById from '@/queries/subsquid/general/collectionById.query'
const NuxtImg = resolveComponent('NuxtImg')
const collectionId = computed(() => route.params.id as string)
const route = useRoute()
const { client } = usePrefix()
const { data, refetch } = useGraphql({
queryName: 'collectionById',
const { data, refresh: refetch } = useAsyncQuery({
query: collectionById,
variables: {
id: collectionId.value,
},
clientId: client.value,
})
const collectionAvatar = ref('')
Expand All @@ -60,9 +62,7 @@ const bannerImageUrl = computed(
)
watch(collectionId, () => {
refetch({
id: collectionId.value,
})
refetch()
collectionAvatar.value = ''
})
Expand All @@ -76,7 +76,9 @@ watchEffect(async () => {
collectionAvatar.value = sanitizeIpfsUrl(image)
collectionName.value = name
} else {
const meta = (await processSingleMetadata(metadata)) as NFTMetadata
const meta = (await processSingleMetadata(
metadata as string,
)) as NFTMetadata
const metaImage = sanitizeIpfsUrl(meta?.image)
const metaName = meta?.name
Expand All @@ -93,21 +95,21 @@ watchEffect(async () => {
useSeoMeta({
title: collectionName,
description: () =>
convertMarkdownToText(data.value?.collectionEntity.meta?.description),
convertMarkdownToText(data.value?.collectionEntity?.meta?.description),
ogUrl: route.path,
ogTitle: collectionName,
ogDescription: () =>
convertMarkdownToText(data.value?.collectionEntity.meta?.description),
convertMarkdownToText(data.value?.collectionEntity?.meta?.description),
ogImage: () =>
generateCollectionImage(
collectionName.value,
data.value?.nftEntitiesConnection.totalCount,
data.value?.nftEntitiesConnection?.totalCount,
collectionAvatar.value,
),
twitterImage: () =>
generateCollectionImage(
collectionName.value,
data.value?.nftEntitiesConnection.totalCount,
data.value?.nftEntitiesConnection?.totalCount,
collectionAvatar.value,
),
})
Expand Down
6 changes: 3 additions & 3 deletions components/collection/utils/useCollectionDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getVolume } from '@/utils/math'
import { NFT } from '@/components/rmrk/service/scheme'
import { NFTListSold } from '@/components/identity/utils/useIdentity'
import { Stats } from './types'
import collectionBuyEventStatsById from '@/queries/subsquid/general/collectionBuyEventStatsById.query'

export const useCollectionDetails = ({
collectionId,
Expand Down Expand Up @@ -57,9 +58,8 @@ export const useCollectionDetails = ({
}

export const useBuyEvents = ({ collectionId }) => {
const { data } = useGraphql({
queryPrefix: 'subsquid',
queryName: 'collectionBuyEventStatsById',
const { data } = useAsyncQuery({
query: collectionBuyEventStatsById,
variables: {
id: collectionId,
},
Expand Down
10 changes: 7 additions & 3 deletions components/common/NotificationBox/useNotification.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Event, FilterOption } from './types'
import { Interaction as _Interaction } from '@kodadot1/minimark/v1'
import { sortedEventByDate } from '@/utils/sorting'
import collectionByAccountQuery from '@/queries/subsquid/general/collectionByAccount.query'

export const Interaction = {
SALE: _Interaction.BUY,
Expand Down Expand Up @@ -41,8 +42,8 @@ export const useNotification = () => {
return block.number.toNumber()
}

const { data: collectionData } = useGraphql({
queryName: 'collectionByAccount',
const { data: collectionData } = useAsyncQuery({
query: collectionByAccountQuery,
variables: {
account: accountId.value,
},
Expand All @@ -56,7 +57,10 @@ export const useNotification = () => {
})

watch(collectionData, (result) => {
collections.value = result.collectionEntities ?? []
collections.value = result.collectionEntities.map((collection) => ({
id: collection.id,
name: collection.name ?? '',
}))
})

watch(eventData, async (result) => {
Expand Down
120 changes: 0 additions & 120 deletions components/hot/HotTable.vue

This file was deleted.

0 comments on commit 751fb0b

Please sign in to comment.