silverstripe / silverstripe-graphql

Serves Silverstripe data as GraphQL representations
BSD 3-Clause "New" or "Revised" License
52 stars 61 forks source link

Query override error #471

Closed Zeeshanjbd2 closed 2 years ago

Zeeshanjbd2 commented 2 years ago

I have a query in one of my vendor package folder

'readAddresss':
  type: '[Address]'
  args:
    MemberID: ID
    limit: Int
    offset: Int
  resolver: [ 'XYZ\Core\Resolvers\ReadAddressResolver', 'resolveReadAddresss' ]

i want to override this query in my app


'readAddresss':
  type: '[Address]'
  args:
    PurchasingUser: Boolean
    MemberID: ID
    limit: Int
    offset: Int
  resolver: [ 'App\Resolvers\AddressResolver','resolveReadAddresss' ]

But it throws error

[Emergency] Uncaught SilverStripe\GraphQL\Schema\Exception\SchemaBuilderException: Callable array ( 0 => 'App\Resolvers\AddressResolver', 1 => 'resolveReadAddresss', 2 => 'XYZ\Core\Resolvers\ReadAddressResolver', 3 => 'resolveReadAddresss', ) provided to SilverStripe\GraphQL\Schema\Resolver\ResolverReference is not valid

GuySartorelli commented 2 years ago

The resolver callable needs to be a string in your yaml. resolver: "[ 'App\Resolvers\AddressResolver','resolveReadAddresss' ]"

GuySartorelli commented 2 years ago

I'm going to close this with the assumption that you have resolved the issue as I described. If this is still a problem for you feel free to re-open it.