Problem/Motivation
With the new graphql version I get the following error:
Fatal error: Declaration of Drupal\access_unpublished\Plugin\GraphQL\DataProducer\AccessUnpublishedRouteLoad::resolveField(Drupal\graphql\GraphQL\Execution\FieldContext $field) must be compatible with Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase::resolveField(Drupal\graphql\GraphQL\Execution\FieldContext $field): mixed in /var/www/html/docroot/modules/contrib/access_unpublished/src/Plugin/GraphQL/DataProducer/AccessUnpublishedRouteLoad.php on line 76
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork access_unpublished-3542258
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
chr.fritschComment #4
generalredneckso a few things. This change, if introduced to our codebase would break current implementations using the currently suppported 8.x-3.6 and 8.x-4.12 versions of graphql. The version you are testing is definitely 5.0.0-alpha3
Even "require-dev" points at 8.x-4.12 so you would need to fix that at the very least in addition to this change.
We may have to write some code that pulls in a version of the plugin based on the version of graphql that a site is using. Not quite sure how to accomplish that.
Comment #5
chr.fritschaccess_unpublishedhas never supported GraphQL 3. For GraphQL 4, I’ve reviewed the changes and confirmed it still works. Adding return types in child classes should be fine. The only requirement is that if a return type is defined in the parent class, all child classes must implement it consistently as well.Comment #6
volkerk commentedLgtm
Comment #7
chr.fritschComment #9
chr.fritsch