Problem/Motivation
We have some small breaking changes that we want to do. For better transparency about that we should do this in a 5.x branch. 2 important things to get done:
- #3512776: Upgrade webonyx/graphql-php dependency to 15.x
- #3513159: Implement strict typing + return types + property types on all our code
Smaller issues:
#3513258: Remove dataproducer_populate_default_values legacy setting
#3516305: Update dev dependencies, fix deprecations, fix todos
#3520035: Merge AlterableComposableSchema into ComposableSchema
Proposed resolution
Start a 5.x git branch and implement it.
Remaining tasks
None, 5.0.0 released: https://www.drupal.org/project/graphql/releases/5.0.0
User interface changes
none.
API changes
A few:
- The underlying webonyx/graphql-php library was updated to version 15.x. There are almost no noticeable breaking changes. In one project we had to change the moethod call
GraphQL\Server\OperationParams::getOriginalInput('mutation_name')to a property access$operation->originalInput['mutation_name'] ?? ''. See also the full 15.0.0 release notes https://github.com/webonyx/graphql-php/releases/tag/v15.0.0 and other small API changes that were done in the graphql module in #3512776: Upgrade webonyx/graphql-php dependency to 15.x. - Implemented strict typing + return types + property types on all graphql code.
- If you extend the class ResolverRegistry the function signatures have changed with types:
public function resolveField(mixed $value, array $args, ResolveContext $context, ResolveInfo $info, FieldContext $field): mixed { - If you implement the interface ResolverInterface the function signature has changed with types:
public function resolve(mixed $value, array $args, ResolveContext $context, ResolveInfo $info, FieldContext $field): mixed { - If you implement a schema plugin the function signatures have changed with types:
public function getSchema(ResolverRegistryInterface $registry): Schema;
public function getResolverRegistry(): ResolverRegistryInterface; - Schema plugin classes: The class AlterableComposableSchema (plugin ID alterable_composable) has been deprecated. The alter events have been merged into the SdlSchemaPluginBase class so they are invoked for all extending schema plugin classes.
- The graphql.settings.yml config has been removed, please delete it from your version control if you have it there. There is an update function included in the graphql module that deletes the config in the database.
- PHP attributes can now be used to define any graphql plugins (schema, schema extension, data producer, persisted query). Old doc comment annotations will continue to work as well.
- Other change records: https://www.drupal.org/list-changes/graphql/published?to_branch=5.x
Data model changes
none
Comments
Comment #2
klausiComment #3
klausiComment #4
klausiComment #5
klausiComment #6
pfrenssenNow that we are planning the next major, would it be a good idea to get attribute based plugin definitions in?
[#SchemaExtension()]rather than@SchemaExtension.Comment #7
pfrenssenI made issues for our 4 plugin types:
Would it be OK to include these in the roadmap for the 5.x branch?
Comment #8
klausiSure, but those annotation changes are not breaking changes? So we could do the them anytime later as well?
But if you would like to work on them I'm happy to include the conversions!
Comment #9
almunnings✅ Very easy upgrade for GraphQL Compose, I was just missing a
fieldson anObjectType./subscribing
Comment #10
klausiTurns out the remaining LoigicExceptions in code are correct, I don't think we can remove them.
Comment #11
klausiComment #12
klausiAdd #3520035: Merge AlterableComposableSchema into ComposableSchema
Comment #13
klausiThe first alpha version was released, please test! https://www.drupal.org/project/graphql/releases/5.0.0-alpha1
Comment #14
klausiGraphQL 5.0.0-alpha3 released!
Mostly refactoring to use PHP attributes and some bug fixes.
Thank you Daniel Bosen, Al Munnings, Andrii Aleksandrov and Ben Stallings for contributing fixes!
https://www.drupal.org/project/graphql/releases/5.0.0-alpha3
I think we can do the first beta soon, let me know of any blockers you see.
Comment #15
klausistarted preparing the API changes for the 5.0.0 release notes.
Should probably be moved to a change record at some point.
I'm planning to release a first beta version soon, thanks a lot for testing the alpha release (2 issues on that fixed already in 5.x dev).
Comment #16
klausitypos
Comment #17
klausiGraphQL 5.0.0-beta1 released, please test!
Comment #18
klausiGraphQL for Drupal 5.0.0-beta2 released!
Minor changes sine beta1, fixing a user cacheability issue and added support for node preview and entity revisions.
We are nearing a stable 5.0 release, pending some improvements @Kingdutch is currently working on.
https://www.drupal.org/project/graphql/releases/5.0.0-beta2
Please test!
Comment #19
klausiGraphQL for Drupal 5.0.0-beta3 released, please test!
Change records: https://www.drupal.org/list-changes/graphql/published?to_branch=5.x
https://www.drupal.org/project/graphql/releases/5.0.0-beta3
Comment #20
kingdutchGiven that it requires breaking changes #3586965: Fix dependency injection anti-patterns is currently still a release blocker besides the other nearly merged things.
Comment #21
kmontyIf #3586965: Fix dependency injection anti-patterns requires breaking changes, shouldn't that be in the 6.x branch, as 5.x is already in beta? (betas are not supposed to introduce new BCs).
I believe this is particularly relevant given the module's maintainers pushing people to upgrade to the 5.x beta to attend to the graphql-php security vulnerability.
Comment #22
kingdutchSemVer is all about communication.
Although there's some precedence for this, there's nothing in the SemVer description that would require this. See also point 9:
The specific changes that are needed are minor and unlikely to affect anyone. However, we expect that people pay more attention when updating from one pre-release to another, so just in case anyone did extend the affected classes it's safer to do before we indicate stability with 5.0.0.
People are welcome to wait for a stable release, which is expected in May, or to contribute a backwards compatible fix for 4.x. Unfortunately as maintainers we can only spend our time once, so yes, we are currently focused on getting 5.0.0 stabilized and out the door as soon as possible.
We're already running the 5.0.0 beta in production ourselves and consider the version secure. However, we want to use the opportunity of the new release to make sure we get in any cleanup that may require people to change their code and thus have not yet tagged 5.0.0 at which point we will once again prioritize not requiring code updates from dependent projects during updates.
Comment #23
kingdutchRC 1 has been released https://www.drupal.org/project/graphql/releases/5.0.0-rc1 🎉
Comment #24
klausiI did not see any new issues reported, so I think we are ready to tag 5.0. What do you think?
Comment #25
kingdutchI agree! Will you do the honors? :)
Comment #26
klausiGraphQL 5.0.0 stable released, congrats everyone! https://www.drupal.org/project/graphql/releases/5.0.0
I would personally like to thank all contributors and give a special shout-out to @kingdutch, who put it in a lot of thought and work making this module better. I could not do it without you!
Comment #28
pfrenssenGreat work, thanks very much!!!
Comment #29
solideogloria commentedThanks everyone!