Unclear behavior with "nan" and "inf" query argument values
Opened this issue · 1 comments
We currently also allow "nan" and "inf" as input values for GraphQLFloat
and GraphQLDecimal
in deserialize_json_argument
and in validate_argument_types
. However, we don't have a single integration test where with float("nan")
or Decimal("inf")
arguments.
So we don't really know if we are returning a "standard python representation that can be used in queries" in deserialize_json_argument
or if the validation in validate_argument_types
"is stricter than the validation done by any specific backend"
So I think that we should either add integration tests proving that these values can be used in database queries or disallow them.
Did some exploratory work:
For MSSQL, filtering on float("nan")
or float("inf")
leads to a sqlalchemy ProgrammingError with SQL Server. Filtering on Decimal("nan")
or Decimal("inf")
doesn't lead to any errors, but filtering on less than < Decimal("inf")
lead to no results on the test query.
For OrientDB, it didn't lead to any errors, but filtering on < Decimal("inf")
didn't lead to any results either.
For neo4j, filtering on < float("inf")
worked. Neo4j doesn't support decimal types.
We don't have numeric tests for redisgraph so I wasn't able to test this.
Disclaimer: I am not sure how to insert "nan" or "inf" values into the target databases and didn't bother to try figuring it out.