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:
@@ -1,4 +1,8 @@
|
||||
const items = ref<any[]>([])
|
||||
import type { GetTeamAddressesQueryResult } from '~/composables/graphql/team/teams-generated'
|
||||
|
||||
type TeamAddress = NonNullable<NonNullable<GetTeamAddressesQueryResult['teamAddresses']>[number]>
|
||||
|
||||
const items = ref<TeamAddress[]>([])
|
||||
const isLoading = ref(false)
|
||||
const isInitialized = ref(false)
|
||||
|
||||
@@ -23,7 +27,7 @@ export function useTeamAddresses() {
|
||||
try {
|
||||
const { GetTeamAddressesDocument } = await import('~/composables/graphql/team/teams-generated')
|
||||
const data = await execute(GetTeamAddressesDocument, {}, 'team', 'teams')
|
||||
items.value = data?.teamAddresses || []
|
||||
items.value = (data?.teamAddresses || []).filter((a): a is TeamAddress => a !== null)
|
||||
isInitialized.value = true
|
||||
} catch (e) {
|
||||
console.error('Failed to load addresses', e)
|
||||
|
||||
Reference in New Issue
Block a user