Skip to content

Default field value for Input Object #1171

Closed
@Vincz

Description

@Vincz
Q A
Bug report? yes
Version/Branch 1.1.0

The changes introduce in this PR #1143, breaks the usage of default value in PHP for Input fields. @deeky666

#[GQL\Input]
class TestInput {
    #[GQL\Field(type: "String")]
    public string myField = "default_value"; // <-- This doesn't work anymore
}

Either the MetadataParser should check this when generating the type and add a defaultValue on the input field, or this field should be skip in the ArgumentsTransformer.
Adding an FieldInput annotation/attribute should also be considered (as currently, the #GQL\Field does not allow a default value).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions