Open nuncanada opened 5 years ago
How about leave the query side to doctrine relationship fetch
attributes. Will it helps?
I think the correct decision would be to use the
Default Field Resolver for webonyx library.
Create a class with a method that will be used as the default callback.
Instead of all these callbacks. Once that is done, it should be easy to adapt my code to eliminate the N+1 problem. And that will eliminate the serialization problem also.
Currently to fetch the values of deep relationships, the code uses resolves with 'get'.ucfirst($resolveInfo->fieldName) path by path.
That will yield bad performance for deep graphs where you want just a few of the values.
It is much better to do a big query with a lot of joins when possible (not possible for ONE-TO-MANY and MANY-TO-MANY).
I do have working code that solves that already. Maybe I should create some library and publish it?