Skip to content

Query with default values does not work #155

@ZirgVoice

Description

@ZirgVoice

A recent fix addressed self-analysis with default values. It seems that queries are no longer working. I'm receiving the following error:

{
  "errors": [
    {
      "message": "Argument \"restart\" got invalid value 0.\nExpected type \"Boolean\", found 0.",
      "path": []
    }
  ]
}

The error occurs when I don't pass anything into the field that has a default value. However, when I provide data for this field, everything works fine.
Query example:
With an error

query Query($runRaceSessionId: ID!, $onlyPaidSims: Boolean!) {
  runRaceSession(id: $runRaceSessionId, onlyPaidSims: $onlyPaidSims)
}
{
  "runRaceSessionId": "01JAT8TRSF3F7AP97A9GCX1E1S",
  "onlyPaidSims": false
}

Without error

query Query($runRaceSessionId: ID!, $onlyPaidSims: Boolean!, $restart: Boolean!) {
  runRaceSession(id: $runRaceSessionId, onlyPaidSims: $onlyPaidSims, restart: $restart)
}
{
  "runRaceSessionId": "01JAT8TRSF3F7AP97A9GCX1E1S",
  "onlyPaidSims": false,
  "restart": false
}

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions