overblog / GraphQLBundle

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

PHP attribute field definition for not null? #1140

Open jsakars opened 9 months ago

jsakars commented 9 months ago
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes/no
Version/Branch 1.0.0

Hi!

#[GQL\Field(type: Type::STRING)] can be used to specify that given input field is a string - nullable

In order to define not null string the only option is: #[GQL\Field(type: 'String!')]

Is there a smoother option rather then using string 'String!? Something like #[GQL\Field(type: Type::STRING!)] maybe?

References https://github.com/webonyx/graphql-php/issues/1462