-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
GraphQL schema building fails and is inefficient #16182
Comments
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
okay. This is a 2.0 issue. If your PR is ready before the triage meeting in 2 hours, we can probably review the changes today. Trying to finish all the issues that are tagged with 2.0 |
I added a PR as a proposal. Not sure about it, maybe too many changes... 😇 I changed how the GraphQL types are accessed quite a lot. |
Note that reverting #16143 will not fix the error, because schema building breaks with a different error... |
Describe the bug
After merging #16143, building the GraphQL schema may fail if a field is resolved through DI multiple times.
E.g. if we have a content type with a media field and also a
CustomUserSetting
with another media field as well, it fails with:This comes from the fact that
ObjectGraphType<T>
s are now resolved multiple times as @tropcicstefan pointed out. The types are added manually to the schema and are also resolved by initializing the schema. This causes conflicting instances being used.As we cannot register the GraphQL types as neither
Scoped
norSingleton
, we must ensure that building the schema will always use the correct instances. This may require some rework how we build the schema.The text was updated successfully, but these errors were encountered: