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:

  1. #3512776: Upgrade webonyx/graphql-php dependency to 15.x
  2. #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:

  1. 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 callGraphQL\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.
  2. Implemented strict typing + return types + property types on all graphql code.
  3. 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 {
  4. 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 {
  5. If you implement a schema plugin the function signatures have changed with types:
    public function getSchema(ResolverRegistryInterface $registry): Schema;
    public function getResolverRegistry(): ResolverRegistryInterface;
  6. 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.
  7. 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.
  8. 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.
  9. Other change records: https://www.drupal.org/list-changes/graphql/published?to_branch=5.x

Data model changes

none

Comments

klausi created an issue. See original summary.

klausi’s picture

Version: 8.x-4.x-dev » 5.x-dev
klausi’s picture

Issue summary: View changes
klausi’s picture

Issue summary: View changes
klausi’s picture

Issue summary: View changes
pfrenssen’s picture

Now that we are planning the next major, would it be a good idea to get attribute based plugin definitions in? [#SchemaExtension()] rather than @SchemaExtension.

pfrenssen’s picture

klausi’s picture

Sure, 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!

almunnings’s picture

✅ Very easy upgrade for GraphQL Compose, I was just missing a fields on an ObjectType.

/subscribing

klausi’s picture

Issue summary: View changes

Turns out the remaining LoigicExceptions in code are correct, I don't think we can remove them.

klausi’s picture

Issue summary: View changes
klausi’s picture

klausi’s picture

The first alpha version was released, please test! https://www.drupal.org/project/graphql/releases/5.0.0-alpha1

klausi’s picture

GraphQL 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.

klausi’s picture

Issue summary: View changes

started 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).

klausi’s picture

Issue summary: View changes

typos

klausi’s picture

GraphQL 5.0.0-beta1 released, please test!

klausi’s picture

GraphQL 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!

klausi’s picture

kingdutch’s picture

Given that it requires breaking changes #3586965: Fix dependency injection anti-patterns is currently still a release blocker besides the other nearly merged things.

kmonty’s picture

If #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.

kingdutch’s picture

SemVer is all about communication.

as 5.x is already in beta? (betas are not supposed to introduce new BCs).

Although there's some precedence for this, there's nothing in the SemVer description that would require this. See also point 9:

A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version.

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.

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.

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.

kingdutch’s picture

Status: Active » Needs review
klausi’s picture

Status: Needs review » Reviewed & tested by the community

I did not see any new issues reported, so I think we are ready to tag 5.0. What do you think?

kingdutch’s picture

I agree! Will you do the honors? :)

klausi’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

GraphQL 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!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pfrenssen’s picture

Great work, thanks very much!!!

solideogloria’s picture

Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.