Closed mathroc closed 4 months ago
@mathroc to answer your questions:
#[GQL\Arg]
should be the priority.#[GQL\Arg]
You are right, we could also explore the possibility to set attributes directly on the arguments.
and for the last question, I can answer it by looking at the tests: yes sometimes the guessing can't work at all, e.g.: arrays
:thinking:
Yes, and we want an error when we don't have a corresponding #[GQL\Arg]
and the auto-guess failed.
To make this work, you first need to get arguments having a corresponding#[GQL\Arg]
and auto-guess only the remaining ones (by passing the list of already resolved to the auto-guesser for example).
How should the arguments be ordered? if it has any importance)
@mathroc The GraphQL arguments order doesn't matter as they are named. But we need them in the right order when the PHP method is called.
ok, I think the PR is fine then, let me know if there's anything to do. (should I squash the commits?)
When a single argument is described with
#[GQL\Arg]
all other are not guessed anymoreThis commit starts by guessing all arguments and override the ones that have
#[GQL\Arg]
attributes describing themI'm not sure of a few things:
in the future it would be nice if we could add the attribute on the argument directly instead of the method so we could make the name & type optional there (or forbidden?)