Benedikt Franke
Benedikt Franke
Spotted the issue: you must implement `ArgDirective` - see https://lighthouse-php.com/master/custom-directives/argument-directives.html#argument-directives
That behaviour comes from the `webonyx/graphql-php` default field resolver. https://github.com/webonyx/graphql-php/pull/760 attempts to improve this.
Let's keep this open, depending on the outcome of the other PR we might change something in Lighthouse.
Given that `webonyx/graphql-php` most likely will not change the default resolver implementation (see https://github.com/webonyx/graphql-php/pull/760#issuecomment-765895130), and I don't even think it should, we can look into providing a custom default resolver...
I think the stance we took in `graphql-php` was the right call, and Laravel is slow and heavy to implement change. I strongly prefer fixing issues upstream, but sometimes a...
You can add a PR with another default field resolver that checks for `instanceof Model` and does a more efficient lookup then. We can make it opt-in at first, then...
We currently use `Executor::getDefaultFieldResolver()`. We can replace that with a custom function, which then contains the check, using the resolver argument `$root`.
Please reformulate in terms of a feature request and use the appropriate template, this is clearly not a bug.
As hinted at in our implementation, `upsert()` is only available from Laravel 8.10 onwards. To properly support it, we will have to enable passing the appropriate metadata through the directive....
@mbalandis @eNzyOfficial Why don't you define the columns `uuid` or `id` respectively as the primary key for the model in question? Why have multiple identifiers in the first place?