Skip to content

Parameter is missing for class constructor for boolean properties #481

Closed
@ozahorulia

Description

@ozahorulia

Input class:

#[Input]
class SomeInput
{
    public function __construct(
        #[Field(inputType: 'Boolean!')]
        public readonly bool $x,

        #[Field(inputType: 'Boolean!')]
        public readonly bool $y,
    ) {
    }
}

Mutation:

mutation {
  updateSomething(someInput:
    {
      x: false
      y: false
    }
  )
}

Result:

"Parameter 'x' is missing for class 'SomeInput' constructor. It should be mapped as required field."

If I change type to any other (e.g. string) - it works. If I pass true instead of false as x or y argument - it also works.
Looks like problem occurs for boolean fields with false values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions