Introduce a DecoratableTypeResolver base class#1213
Introduce a DecoratableTypeResolver base class#1213chrfritsch wants to merge 13 commits intodrupal-graphql:8.x-4.xfrom
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.