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

@@ -4,8 +4,8 @@ import { SuppliersListDocument, NearestSuppliersDocument } from '~/composables/g
const PAGE_SIZE = 500
// Types from codegen
type SupplierItem = NonNullable<NonNullable<SuppliersListQueryResult['suppliersList']>[number]>
type NearestSupplierItem = NonNullable<NonNullable<NearestSuppliersQueryResult['nearestSuppliers']>[number]>
type SupplierItem = NonNullable<NonNullable<SuppliersListQueryResult['suppliers_list']>[number]>
type NearestSupplierItem = NonNullable<NonNullable<NearestSuppliersQueryResult['nearest_suppliers']>[number]>
// Shared state across list and map views
const items = ref<Array<SupplierItem | NearestSupplierItem>>([])
@@ -41,7 +41,7 @@ export function useCatalogSuppliers() {
'public',
'geo'
)
items.value = (data?.nearestSuppliers || []).filter((s): s is NearestSupplierItem => s !== null)
items.value = (data?.nearest_suppliers || []).filter((s): s is NearestSupplierItem => s !== null)
total.value = items.value.length
isInitialized.value = true
return
@@ -63,7 +63,7 @@ export function useCatalogSuppliers() {
'public',
'geo'
)
const next = (data?.suppliersList || []).filter((s): s is SupplierItem => s !== null)
const next = (data?.suppliers_list || []).filter((s): s is SupplierItem => s !== null)
items.value = replace ? next : items.value.concat(next)
// suppliersList doesn't return total count, estimate from fetched items