-
Notifications
You must be signed in to change notification settings - Fork 201
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
Introduce a DecoratableTypeResolver base class #1213
base: 8.x-4.x
Are you sure you want to change the base?
Conversation
For anyone interested you can view the current implementation in Open Social. Could you run the following to add an interface? This would allow Open Social to implement the interface and have an upgrade path :D
You can view the patch file and commit message at https://gist.github.com/Kingdutch/5990c24a2734c5fb01e26cf444f44c18 |
The interface allows alternative but compatible decoratable type resolvers to be created. It also provides an upgrade path for projects that were already using the pattern.
Thanks, I think this could be useful. I don't understand it fully yet, could you describe the use case in the description above a bit? Like with a concrete schema + type, the resolver setup snippet and what benefit this brings vs. a conventional resolver. I got some hints from the Open Social comments, so we should definitely pull them in. Thanks @Kingdutch for supplying that here. |
Ah, and we should have some test coverage that uses this class and demonstrates that it works. |
I can add test coverage later this week. A quick usage example as seen in Open Social would be: $registry->addTypeResolver('Actor', new UserActorTypeResolver($registry->getTypeResolver('Actor'))); I debated adding a |
While working on the graphql integration for the Thunder distribution, I discovered this useful base class in the OpenSocial project.
I think it would make a lot of sense to have it in the main graphql module.