Skip to content

Annotations & Interfaces / Unions auto-discovery #701

@Vincz

Description

@Vincz
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Version/Branch 1.0.0

It could be great to auto-discover a GraphQL Type Unions & Interfaces with annotations.
For a given PHP class we could loop through parents & interfaces.
If one of this parents or interfaces is a GraphQL Interface or Union itself :

  • If it's an interface, the interface is added to the GraphQL type
  • If it's an union, the GraphQL type is added to the union

On @GQL\Type, we could had a autodiscoverInterfaces option (true by default) and the auto-discovery would only apply if the interfaces option is not already set.

On @GQL\Union, we could had a autodiscoverTypes option (true by default) and the auto-discovery would only apply if the types option is not already set.

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