GraphQLBundle icon indicating copy to clipboard operation
GraphQLBundle copied to clipboard

Ignoring of the name parameter of field attribute

Open qnixdev opened this issue 1 year ago • 3 comments

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Version 0.15.2

Hello all! I'm trying to change the name of a field, but I'm getting a name error... In the parameter I explicitly specified the property name, but it is ignored. I have a transformer that converts a value to a timestamp before creating an object (implementation omitted for brevity).

use Overblog\GraphQLBundle\Annotation as GQL;

#[GQL\Input(name: 'MyInput')]
class MyInputType
{
    #[GQL\Field(name: 'endTime', type: 'String!')]
    private int $endTimestamp;
}
{
    "message": "Variable \"$input\" got invalid value {\"endTime\":\"18:00\"}; Field value.endTimestamp of required type String! was not provided.",
    "extensions": {
        "category": "graphql"
    },
    "locations": [
        {
            "line": 1,
            "column": 24
        }
    ]
}

qnixdev avatar Mar 05 '24 14:03 qnixdev

Hey @qnixdev! Looks like a cache problem to me. Did you check the generated Input?

Vincz avatar Mar 05 '24 14:03 Vincz

Hey @qnixdev! Looks like a cache problem to me. Did you check the generated Input?

Yes of course I checking the generated Input. Also I'am cleared all the cache, but this didn't help(( If open the /graphiql documentation, the property name will also be generated from the field name..

qnixdev avatar Mar 05 '24 14:03 qnixdev

Hi @qnixdev Any news about this? Have you been able to fix it?

Vincz avatar Mar 30 '24 16:03 Vincz