refactor: remove all any types, add strict GraphQL scalar typing
All checks were successful
Build Docker Image / build (push) Successful in 4m3s
All checks were successful
Build Docker Image / build (push) Successful in 4m3s
- Add strictScalars: true to codegen.ts with proper scalar mappings (Date, Decimal, JSONString, JSON, UUID, BigInt → string/Record) - Replace all ref<any[]> with proper GraphQL-derived types - Add type guards for null filtering in arrays - Fix bugs exposed by typing (locationLatitude vs latitude, etc.) - Add interfaces for external components (MapboxSearchBox) This enables end-to-end type safety from GraphQL schema to frontend.
This commit is contained in:
@@ -44,7 +44,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { GetNodeDocument, NearestOffersDocument } from '~/composables/graphql/public/geo-generated'
|
||||
import { GetNodeDocument, NearestOffersDocument, type OfferWithRouteType, type GetNodeQueryResult } from '~/composables/graphql/public/geo-generated'
|
||||
|
||||
type Hub = NonNullable<GetNodeQueryResult['node']>
|
||||
|
||||
definePageMeta({
|
||||
layout: 'topnav'
|
||||
@@ -56,7 +58,7 @@ const { t } = useI18n()
|
||||
|
||||
const isLoading = ref(true)
|
||||
const hoveredId = ref<string>()
|
||||
const hub = ref<any>(null)
|
||||
const hub = ref<Hub | null>(null)
|
||||
const products = ref<Array<{ uuid: string; name: string }>>([])
|
||||
|
||||
const hubId = computed(() => route.params.id as string)
|
||||
@@ -150,7 +152,7 @@ try {
|
||||
|
||||
// Group offers by product
|
||||
const productsMap = new Map<string, { uuid: string; name: string }>()
|
||||
offersData.value?.nearestOffers?.forEach((offer: any) => {
|
||||
offersData.value?.nearestOffers?.forEach((offer) => {
|
||||
if (offer?.productUuid) {
|
||||
if (!productsMap.has(offer.productUuid)) {
|
||||
productsMap.set(offer.productUuid, {
|
||||
|
||||
Reference in New Issue
Block a user