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

Fixes several minor issues when building the GraphQL schema #16151

Merged
merged 23 commits into from
Jun 7, 2024

Conversation

gvkries
Copy link
Contributor

@gvkries gvkries commented May 24, 2024

Fixes #5420
Fixes #6253
Fixes #14592
Fixes #12423
Fixes #14592

@Piedone
Copy link
Member

Piedone commented May 29, 2024

If anybody with more knowledge of GraphQL wants to review, please do. Otherwise, I can do it to an extent, but @gvkries please help by adding PR comments on the sections, pointing which one fixes which issue. That would help a lot.

@hishamco
Copy link
Member

@hyzx86 your review please

Copy link
Contributor

@hyzx86 hyzx86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR related to #8669, that fixed #5536.

@gvkries
Copy link
Contributor Author

gvkries commented May 30, 2024

I corrected the fix for #14592. Dynamically added fields are now correctly assigned to the corresponding part in GraphQL, instead of always being added to the content type (as if they were collapsed).
Note that this requires access to the schema from the IContentTypeBuilders, but that is an improvement I would like to suggest in any case (see #16184).

@gvkries gvkries requested a review from hyzx86 May 30, 2024 09:19
Copy link
Contributor

@hyzx86 hyzx86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Piedone
Copy link
Member

Piedone commented May 30, 2024

Let's merge #16184 before this one so have a more unique diff.

Copy link
Contributor

This pull request has merge conflicts. Please resolve those before requesting a review.

@hishamco
Copy link
Member

@gvkries please resolve the conflicts and let us merge this too

@Piedone
Copy link
Member

Piedone commented May 31, 2024

I'll do a quick review.

Copy link
Member

@Piedone Piedone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indeed fixes #12423, or at least that bug doesn't reproduce with this code.

@gvkries
Copy link
Contributor Author

gvkries commented May 31, 2024

[...] but @gvkries please help by adding PR comments on the sections, pointing which one fixes which issue. That would help a lot.

Do you still need that? Haven't had time to do it yet.

@Piedone
Copy link
Member

Piedone commented May 31, 2024

Not anymore :).

@gvkries
Copy link
Contributor Author

gvkries commented May 31, 2024

Not anymore :).

Okay, thanks. And I'm sorry that I gave you more work 😇

@@ -246,6 +246,11 @@ Here are the updated signatures:

These adjustments ensure compatibility and adherence to the latest conventions within the `SectionDisplayDriver` class.

### GraphQL Module

The GraphQL schema may change, because fields are now always added to the correct part. Previously, additional fields may have been added to the parent content item type directly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional fields may have been added to the parent content item type directly

Not sure what it means, but having content type fields attached to the dynamic part (the implicit one matching the type name) was by design. Does it mean that an Article type will have to access an ArticlePart property in graphql to get the fields?

Copy link
Contributor Author

@gvkries gvkries Jun 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only affects fields that have been added to a statically typed part. E.g. if you add fields to the HtmlBodyPart they were added to the content type directly, which will have failed often because of duplicated field names. The dynamic part itself has not been changed and also collapsing fields to the parent content item type is left unchanged as well. So the schema will only change in rare cases, not commonly.
This is fixing bug #14592.

Copy link
Member

@Piedone Piedone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hishamco please merge if you're OK with it. @sebastienros do you have any other feedback?

@gvkries gvkries requested a review from hishamco June 7, 2024 07:48
src/docs/releases/2.0.0.md Show resolved Hide resolved
@hishamco hishamco merged commit 07a655b into OrchardCMS:main Jun 7, 2024
6 checks passed
@gvkries gvkries deleted the gvkries/graphql-fixes branch June 7, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants