Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query does not return results if filter contains numeric value #64

Open
andreachild opened this issue Jan 29, 2025 · 0 comments
Open

Query does not return results if filter contains numeric value #64

andreachild opened this issue Jan 29, 2025 · 0 comments

Comments

@andreachild
Copy link
Contributor

andreachild commented Jan 29, 2025

If the graphQL query contains a filter with a numeric value, the query will not return any results because the converted open cypher query parameter value will be a string, not a numeric value.

Example (note that runways value is numeric 2):

query MyQuery {
  getNodeAirports(filter: {runways: 2}) {
    type
    city
    icao
    code
    country
    lat
    longest
    runways
    desc
    lon
    region
    elev
  }
}

Resolver outputs this open cypher query (note the quotes around the runways value 2) :

Resolver:  {
  query: 'MATCH (getNodeAirports_Airport:`airport`{runways: $getNodeAirports_Airport_runways})\n' +
    'RETURN collect({type: getNodeAirports_Airport.`type`, city: getNodeAirports_Airport.`city`, icao: getNodeAirports_Airport.`icao`, code: getNodeAirports_Airport.`code`, country: getNodeAirports_Airport.`country`, lat: getNodeAirports_Airport.`lat`, longest: getNodeAirports_Airport.`longest`, runways: getNodeAirports_Airport.`runways`, desc: getNodeAirports_Airport.`desc`, lon: getNodeAirports_Airport.`lon`, region: getNodeAirports_Airport.`region`, elev: getNodeAirports_Airport.`elev`})',
  parameters: { getNodeAirports_Airport_runways: '2' },
  language: 'opencypher',
  refactorOutput: null
}
@andreachild andreachild changed the title Query returns no results if filter contains numeric value Query does not return results if filter contains numeric value Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant