overblog / GraphQLBundle

This bundle provides tools to build a complete GraphQL API server in your Symfony App.
MIT License
788 stars 222 forks source link

Ignoring of the name parameter of field attribute #1163

Open qnixdev opened 8 months ago

qnixdev commented 8 months ago
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
        }
    ]
}
Vincz commented 8 months ago

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

qnixdev commented 8 months ago

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..

Vincz commented 7 months ago

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