Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC break with GraphQL\Server\ServerConfig::setValidationRules signature in 14.11.7 #1221

Closed
andrew-demb opened this issue Sep 21, 2022 · 10 comments

Comments

@andrew-demb
Copy link

Signature of GraphQL\Server\ServerConfig::setValidationRules (

public function setValidationRules($validationRules): self
) has been changed in v14.11.7.

Signature in v14.11.6 -

public function setValidationRules($validationRules)
) were not declared explicit return type.

As of this method marked as @api there were expectations about strong BC promise.
For now this update breaks thecodingmachine/graphqlite-bundle https://github.com/thecodingmachine/graphqlite-bundle/blob/3ae908cc814dfa7283d869789db5852a200a46aa/Server/ServerConfig.php#L27

Proposed solution: revert changing method signature and apply this change only with next major version bump with changelog

@RikvdHeijden
Copy link

This version breaks basically every class that extends from this library in some way. Notable Magento 2 that extends the types and now throws an error because the $name attributes has suddenly been typed as a string.

@mfn
Copy link
Contributor

mfn commented Sep 21, 2022

I think the problem is that the release has been made from the wrong branch, from master, but should have been from the 14.x branch.

Because that type change was done last year… but we had a release in April, not containing it.

Is that possible?

@spawnia
Copy link
Collaborator

spawnia commented Sep 21, 2022

I think the problem is that the release has been made from the wrong branch, from master, but should have been from the 14.x branch.

Because that type change was done last year… but we had a release in April, not containing it.

Is that possible?

Yup, that is it - my bad. Will fix ASAP.

@possi
Copy link

possi commented Sep 21, 2022

Other problems we run into:

  • Type of App\GraphQL\Type\EmailType::$description must be ?string (as in class GraphQL\Type\Definition\ScalarType) (could be fixed in our project)
  • Access to an undefined property GraphQL\Type\Definition\Type::$name (could be fixed in our project)
  • But worst: Overblog\DataLoader\Promise\Adapter\Webonyx\GraphQL\SyncPromiseAdapter::beforeWait(GraphQL\Executor\Promise\Promise $promise) must be compatible with GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter::beforeWait(GraphQL\Executor\Promise\Promise $promise): void Requires Update in 3rdParty-Project: overblog/dataloader-php

@mfn
Copy link
Contributor

mfn commented Sep 21, 2022

Best field test ever 😅

Basically what everyone got was/is 15.x .

Not sure if it's meant to be, but https://github.com/webonyx/graphql-php/blob/master/UPGRADE.md#v14xx--v15xx does not list those things; it only has 2 items.

@mfn
Copy link
Contributor

mfn commented Sep 21, 2022

Possibly related: rebing/graphql-laravel#944

@spawnia
Copy link
Collaborator

spawnia commented Sep 21, 2022

Sorry for the trouble everybody, I just fixed the release to point to a tag on the correct branch - see https://github.com/webonyx/graphql-php/releases/tag/v14.11.7. You might need to remove your composer.lock file and re-run composer update in order to get the fixed version.

@andrew-demb
Copy link
Author

@spawnia can you release a new patch release to avoid manual work with refetching same version with different hash with composer?

@spawnia
Copy link
Collaborator

spawnia commented Sep 21, 2022

Not sure if it's meant to be, but master/UPGRADE.md#v14xx--v15xx does not list those things; it only has 2 items.

The changelog should list all breaking changes, not all of them are properly documented.

@brandonkelly
Copy link

Agree it would be nice if it were 14.11.7.1 or something. We’ve already released a Craft CMS release explicitly listing 14.11.7 as a conflicting package/version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants