Add coordinate-based GraphQL operations for geo API
All checks were successful
Build Docker Image / build (push) Successful in 3m31s
All checks were successful
Build Docker Image / build (push) Successful in 3m31s
- Add NearestHubs.graphql - find hubs near coordinates - Add NearestOffers.graphql - find offers near coordinates - Add NearestSuppliers.graphql - find suppliers near coordinates - Add RouteToCoordinate.graphql - route from offer to coordinates - Regenerate geo-generated.ts with new operations These operations simplify frontend logic by working with coordinates instead of requiring entity-specific queries.
This commit is contained in:
11
graphql/operations/public/geo/NearestHubs.graphql
Normal file
11
graphql/operations/public/geo/NearestHubs.graphql
Normal file
@@ -0,0 +1,11 @@
|
||||
query NearestHubs($lat: Float!, $lon: Float!, $radius: Float, $productUuid: String, $limit: Int) {
|
||||
nearestHubs(lat: $lat, lon: $lon, radius: $radius, productUuid: $productUuid, limit: $limit) {
|
||||
uuid
|
||||
name
|
||||
latitude
|
||||
longitude
|
||||
country
|
||||
countryCode
|
||||
transportTypes
|
||||
}
|
||||
}
|
||||
16
graphql/operations/public/geo/NearestOffers.graphql
Normal file
16
graphql/operations/public/geo/NearestOffers.graphql
Normal file
@@ -0,0 +1,16 @@
|
||||
query NearestOffers($lat: Float!, $lon: Float!, $radius: Float, $productUuid: String, $limit: Int) {
|
||||
nearestOffers(lat: $lat, lon: $lon, radius: $radius, productUuid: $productUuid, limit: $limit) {
|
||||
uuid
|
||||
productUuid
|
||||
productName
|
||||
supplierUuid
|
||||
latitude
|
||||
longitude
|
||||
country
|
||||
countryCode
|
||||
pricePerUnit
|
||||
currency
|
||||
quantity
|
||||
unit
|
||||
}
|
||||
}
|
||||
5
graphql/operations/public/geo/NearestSuppliers.graphql
Normal file
5
graphql/operations/public/geo/NearestSuppliers.graphql
Normal file
@@ -0,0 +1,5 @@
|
||||
query NearestSuppliers($lat: Float!, $lon: Float!, $radius: Float, $productUuid: String, $limit: Int) {
|
||||
nearestSuppliers(lat: $lat, lon: $lon, radius: $radius, productUuid: $productUuid, limit: $limit) {
|
||||
uuid
|
||||
}
|
||||
}
|
||||
26
graphql/operations/public/geo/RouteToCoordinate.graphql
Normal file
26
graphql/operations/public/geo/RouteToCoordinate.graphql
Normal file
@@ -0,0 +1,26 @@
|
||||
query RouteToCoordinate($offerUuid: String!, $lat: Float!, $lon: Float!) {
|
||||
routeToCoordinate(offerUuid: $offerUuid, lat: $lat, lon: $lon) {
|
||||
sourceUuid
|
||||
sourceName
|
||||
sourceLat
|
||||
sourceLon
|
||||
distanceKm
|
||||
routes {
|
||||
totalDistanceKm
|
||||
totalTimeSeconds
|
||||
stages {
|
||||
fromUuid
|
||||
fromName
|
||||
fromLat
|
||||
fromLon
|
||||
toUuid
|
||||
toName
|
||||
toLat
|
||||
toLon
|
||||
distanceKm
|
||||
travelTimeSeconds
|
||||
transportType
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user