Skip to content

GraphQL Boolean argument values are dropped (always null) and Float values are typed as String #6383

Closed

Description

@ruispereira

Summary

Two GraphQL scalar argument types are mis-converted before reaching SQL. BooleanValue.getValue() always returns null (the parsed literal is discarded), and FloatValue.getValue() returns the raw String image instead of a number. Both corrupt the generated SQL: boolean filters compare against null, float filters compare against a quoted string.

Where (HEAD ca89f56)

graphql/src/main/java/com/arcadedb/graphql/parser/BooleanValue.java L30-32:

protected boolean val;              // set by the parser: GraphQLParser sets jjtn000.val = true/false
@Override public Object getValue() { return null; }   // <-- val discarded

graphql/src/main/java/com/arcadedb/graphql/parser/FloatValue.java L30-32:

protected String stringValue;
@Override public Object getValue() { return stringValue; }   // raw image "1.5", not a number

Contrast IntValue.getValue(), which correctly returns the parsed int. (The parser even carries a //TODO parse! for the float at GraphQLParser.java:3173.)

Consumers: GraphQLSchema.executeQuery reads ...getValue().getValue() (L155) to build the WHERE (L160-172), and GraphQLSchema.getArguments (L239-244) binds @sql-directive params.

Repro

Schema books(inStock: Boolean, rating: Float): [Book].

  • { books(inStock: true) { title } } → generated SQL select from Book where inStock = null (argValue is null; the instanceof String branch is skipped and null is concatenated). Every boolean filter is silently neutralized — including one meant to restrict visibility (where published = true).
  • { books(rating: 4.5) { title } } → because argValue instanceof String is now true, the value is quoted: select from Book where rating = "4.5" — a numeric property compared to a string literal → empty/incorrect results.
  • Native-directive path binds flag = null / rating = "4.5" into the SQL param map the same way.

Suggested fix

BooleanValue.getValue() → return val;. FloatValue.getValue() → parse to a numeric type, e.g. return new BigDecimal(stringValue); (matching IntValue).

Scope / confidence

High confidence — the literal-set-then-discard and the string return are unambiguous, and both call paths are verified. Affects only schemas that declare Boolean/Float arguments.

Activity

  1. added this to the 26.9.1 milestone on Aug 18, 2026
  2. added
    in progress
    on Aug 19, 2026
  3. self-assigned this
    on Aug 19, 2026
  4. added a commit that references this issue on Aug 19, 2026
  5. lvca commented on Aug 19, 2026

    @lvca
    Member

    Fixed in #6451 (merged).

  6. removed
    in progress
    on Aug 19, 2026
  7. added
    graphql
    on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggraphql

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions