Skip to content

Cleanup GraphQL Localization - #17196

Merged
MikeAlhayek merged 3 commits into
mainfrom
ma/grapql-localization
Dec 10, 2024
Merged

MikeAlhayek merged 3 commits into
mainfrom
ma/grapql-localization

Conversation

@MikeAlhayek

Copy link
Copy Markdown
Member

No description provided.

@MikeAlhayek
MikeAlhayek requested a review from gvkries December 9, 2024 21:11
@gvkries

gvkries commented Dec 10, 2024

Copy link
Copy Markdown
Member

I'm not sure if we should do this, after all the discussions about breaking changes lately. The where types can be used directly, even if it is not the case in OC itself. Also, I don't see anything that could be made abstract in the base classes. So I don't see enough advantage of introducing another breaking change.

Anyway, if we do it, the c'tors should be protected.

P.S.: The PR description is misleading, why is it related to localization?

@gvkries gvkries added the breaking change 💥 Issues or pull requests that introduces breaking change(s) label Dec 10, 2024
@MikeAlhayek

Copy link
Copy Markdown
Member Author

Anyone project is able to inherit these classes. Now they have to provide the IStringLocalizer into the base constructor. The base constructor should accept any IStringLocalizer not only IStringLocalizer<>. This way the derived classes don't need to resolve the wrong Localizer to pass to the base class.

It's abstract because these classes don't exist alone. They are base classes. Aren't they? Since I replaced IStringLocalizer<> with IStringLocalizer, this will cause an exception if someone added it to the IoC and tries to resolve it.

@gvkries gvkries left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, I added that parameter, I forgot about it. Than it's already a breaking change introduced by myself. We could either fix that or you can go ahead, I'm fine with whatever you want.

@gvkries gvkries removed the breaking change 💥 Issues or pull requests that introduces breaking change(s) label Dec 10, 2024
@MikeAlhayek

Copy link
Copy Markdown
Member Author

We could either fix that or you can go ahead

That is what this PR fixes. Do you see something else that I missed?

@gvkries

gvkries commented Dec 10, 2024

Copy link
Copy Markdown
Member

We could either fix that or you can go ahead

That is what this PR fixes. Do you see something else that I missed?

My change is still a breaking one after this PR, because the parameter less c'tor is missing. I mean we can either make the string localizer optional with a default one so my change is not breaking anymore, or go ahead and formalize the actual intent of these classes being base classes. That's how I understand your change. Isn't that correct?

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

Successfully merging this pull request may close these issues.

2 participants