GraphQLBundle icon indicating copy to clipboard operation
GraphQLBundle copied to clipboard

Use multiple Entity Managers and Connections

Open PGBastien opened this issue 8 years ago • 1 comments

I have multiple Entity Managers and Connections in my Symfony project and all is OK https://symfony.com/doc/current/doctrine/multiple_entity_managers.html

Now I would like to use multiple Entity Managers in my resolvers or fields but I do not know how to do.

Thanks

PGBastien avatar Aug 04 '17 16:08 PGBastien

If this can help you, in my services.yml

I create new em em_other: class: Doctrine\ORM\EntityManager factory: ['@doctrine', 'getManager'] arguments: ["other"]

and new resolver base resolver.other: class: AppBundle\Resolver\AbstractResolver abstract: true calls: [ init, ['@em_other']]

and edit parent of resolver resolver.customers: class: AppBundle\Resolver\WstiersResolver parent: 'resolver.other'

PGBastien avatar Aug 08 '17 08:08 PGBastien