after upgrading package to v4, in addition with latest version of webonyx/graphql and nuwave/lighthouse, it is impossible to use @searchBy directive with custom resolver directive.
I have @report directive which is very similar to @all directive, but adds some eloquent builder methods.
When I remove filter: CouponFilter @searchBy from couponReport - everything is fine.
When I change @report to @all in couponReport query - everything is fine.
When I change body of @report directive class to be exactly as @all - does not work
When I change CouponReport to Coupon as return type of couponReport query - does not work.
Error is:
LastDragon_ru\LaraASP\GraphQL\Builder\Exceptions\TypeDefinitionImpossibleToCreateType
Definition `LastDragon_ru\LaraASP\GraphQL\SearchBy\Types\Scalar`: Impossible to create type for type `input CouponFilter { id }`.
at vendor/lastdragon-ru/lara-asp-graphql/src/Builder/Manipulator.php:97
93▕ // Create new
94▕ $node = $instance->getTypeDefinitionNode($this, $name, $source);
95▕
96▕ if (!$node) {
➜ 97▕ throw new TypeDefinitionImpossibleToCreateType($definition, $source);
98▕ }
99▕
100▕ if ($name !== $this->getNodeName($node)) {
101▕ throw new TypeDefinitionInvalidTypeName($definition, $name, $this->getNodeName($node));
The error must happened with recent changes, because before version 4 I was using dev-master and everything was fine.
Thanks for the report. I've added the fix to the master branch, please see Builder type detection. Let me know please if you have any question or it doesn't work :) (if all fine I will release new version soon).
Hello,
after upgrading package to v4, in addition with latest version of webonyx/graphql and nuwave/lighthouse, it is impossible to use @searchBy directive with custom resolver directive.
I have
@report
directive which is very similar to@all
directive, but adds some eloquent builder methods.My schema is:
filter: CouponFilter @searchBy
fromcouponReport
- everything is fine.@report
to@all
incouponReport
query - everything is fine.@report
directive class to be exactly as@all
- does not workCouponReport
toCoupon
as return type ofcouponReport
query - does not work.Error is:
The error must happened with recent changes, because before version 4 I was using dev-master and everything was fine.
Edit:
Probably it is related with commit https://github.com/LastDragon-ru/lara-asp/commit/c3ffa70c2c7f5a676edd022fdfbd04593ccb747e
But that way disables usage of custom resolvers :(