Fix geo GraphQL schema mismatch: camelCase → snake_case
All checks were successful
Build Docker Image / build (push) Successful in 5m46s

All geo .graphql operations and consuming code updated to match
server schema which uses snake_case field/argument names.
Removed non-existent QuoteCalculations query, using NearestOffers instead.
This commit is contained in:
Ruslan Bakiev
2026-03-09 21:45:57 +07:00
parent 15563991df
commit 25f946b293
34 changed files with 504 additions and 744 deletions

View File

@@ -1,5 +1,5 @@
import { GetClusteredNodesDocument } from './graphql/public/geo-generated'
import type { ClusterPointType } from './graphql/public/geo-generated'
import type { ClusterPoint } from './graphql/public/geo-generated'
export interface MapBounds {
west: number
@@ -12,13 +12,10 @@ export interface MapBounds {
export function useClusteredNodes(
transportType?: Ref<string | undefined>,
nodeType?: Ref<string | undefined>,
productUuid?: Ref<string | undefined>,
hubUuid?: Ref<string | undefined>,
supplierUuid?: Ref<string | undefined>
) {
const { client } = useApolloClient('publicGeo')
const clusteredNodes = ref<ClusterPointType[]>([])
const clusteredNodes = ref<ClusterPoint[]>([])
const loading = ref(false)
const fetchClusters = async (bounds: MapBounds) => {
@@ -34,14 +31,11 @@ export function useClusteredNodes(
zoom: Math.floor(bounds.zoom),
transportType: transportType?.value,
nodeType: nodeType?.value,
productUuid: productUuid?.value,
hubUuid: hubUuid?.value,
supplierUuid: supplierUuid?.value
},
fetchPolicy: 'network-only'
})
clusteredNodes.value = (data?.clusteredNodes ?? []).filter(Boolean) as ClusterPointType[]
clusteredNodes.value = (data?.clustered_nodes ?? []).filter(Boolean) as ClusterPoint[]
} catch (error) {
console.error('Failed to fetch clustered nodes:', error)
clusteredNodes.value = []