Skip to content

Unhelpful error message when a query is defined twice #322

Closed
@lexmes

Description

@lexmes

Lets assume we have to following setup:

class ControllerA {
  /**
   * @Query()
   * @returns string[]
   */
  allPosts() : array;
}

...

class ControllerB {
  /**
   * @Query()
   * @returns string[]
   */
  allPosts() : array;
}

Right now the error message that i get is: assert($firstDuplicate instanceof FieldDefinition). Thats not very helpful. I would suggest something along the lines of cannot redeclare query "allPosts" in controller "<FQDN>\ControllerB" as it was already defined in <FQDN>\ControllerA.

I don't know if its my setup that is causing this error. But even then its not very helpful.

The error is generated in AggregateControllerQueryProvider.php:98.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions