Skip to content

Falsy PhpStan exception #1177

@GeoSot

Description

@GeoSot

Versions:

  • graphql-laravel Version: latest
  • Laravel Version: 12
  • PHP Version: 8.3

Description:

I am facing a minor issue, that scopes on Static analysis tools (phpStan)
Having setup some types, for example UserType, I have added fields/properties that are Types(enum|relation)
When I wrap a property of that kind, with a nonNull directive, PhpStan shouts that something is wrong on their declaration, as these types are not nullable.
However the graphQl specification is strict on this, defining that we need to explicit define not null properties
The result although is flawless

Image

Image

Steps To Reproduce:

Just add a custom not null property to a GraphQlType fields method

So, do I miss something? Is there a workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions