End-to-end GraphQL recipes
The examples below use known Madrid IDs. GraphQL query forms follow the published query signatures.
1. Resolve Madrid
query ResolveMadrid {
search(text: "Madrid", nodeType: "Cities", country_code: "ES", first: 5) {
edges { node { id title node_type address_city country_code } }
pageInfo { hasNextPage endCursor }
}
}Select the Madrid city result with ID 27799. Do not assume the first result is always correct for ambiguous names.
2. Discover and rank attractions
query MadridAttractions {
descendantsOf(
ancestorId: "27799"
nodeType: "Attractions"
place_score_gte: 80
orderBy: { field: PLACE_SCORE, direction: DESC }
first: 15
) {
edges { cursor node { id title place_score rating rating_votes category address } }
pageInfo { hasNextPage endCursor }
}
}3. Find Italian restaurants with a minimum rating and review count
query MadridDining {
descendantsOf(
ancestorId: "27799"
nodeType: "Restaurants"
category: "Italian"
rating_gte: 4.3
rating_votes_gte: 50
price_level: "moderate"
first: 20
) {
edges { node { id title rating rating_votes category price_level address } }
pageInfo { hasNextPage endCursor }
}
}4. Search a keyword only in Madrid
query MadridRooftopBars {
search(text: "rooftop", ancestor_id: "27799", nodeType: "Bars", first: 15) {
edges { node { id title rating address location { lat lon } } }
pageInfo { hasNextPage endCursor }
}
}5. Discover neighbourhoods directly under a city
query MadridNeighbourhoods {
childrenOf(parentId: "27799", nodeType: "Neighbourhoods", first: 50) {
edges { node { id title child_count } }
pageInfo { hasNextPage endCursor }
}
}If no neighbourhoods appear, inspect unfiltered direct children and use recursive discovery as appropriate; some hierarchies include intermediary nodes.
6. Nearby attractions within a geographic subtree
query MadridNearby {
descendantsOf(
ancestorId: "27799"
nodeType: "Attractions"
lat: 40.4138
lon: -3.6921
radius: "2km"
orderBy: { field: DISTANCE, direction: ASC }
first: 10
) {
edges { node { id title location { lat lon } address rating } }
pageInfo { hasNextPage endCursor }
}
}Coordinates are approximate example coordinates near the Prado Museum; do not infer verified travel times from straight-line proximity.
7. Get a single venue by ID
query PradoDetails {
node(id: "3127593") {
id title tagline short_description description
category rating rating_votes place_score
address country_code phone url main_image
location { lat lon }
}
}Treat description as potentially HTML-formatted and sanitize before rendering. place_score is the 0–100 Evendo Place Score.
8. Get a place by slug
query MadridBySlug {
bySlugId(slugId: "spain/madrid") {
id title slug_id node_type country_code
}
}9. Global node counts
query Counts {
attractions: nodeCount(nodeType: "Attractions")
restaurants: nodeCount(nodeType: "Restaurants")
}This counts globally, not within Madrid.
10. Page through results
query MadridAttractionsPage($cityId: String!, $cursor: String) {
descendantsOf(ancestorId: $cityId, nodeType: "Attractions", first: 20, after: $cursor) {
edges { cursor node { id title rating } }
pageInfo { hasNextPage endCursor }
}
}Variables on first request: { "cityId": "27799", "cursor": null }. On subsequent requests, provide the exact endCursor from the last page, with all other arguments unchanged.
11. Curl request with GraphQL variables
curl --request POST 'https://evendo.com/api/locationSearchGraphQL' -H 'Content-Type: application/json' --data '{"query":"query ById($id: String!) { node(id: $id) { id title address } }","variables":{"id":"3127593"}}'Also see GraphQL quickstart, exact argument catalog and the runnable examples bundled in examples/graphql/.