-
Notifications
You must be signed in to change notification settings - Fork 222
Closed
Description
| Q | A |
|---|---|
| Bug report? | yes/no |
| Feature request? | yes/no |
| BC Break report? | yes/no |
| RFC? | yes/no |
| Version/Branch | x.y.z |
I'm new in graphql. I try to add entity manger in my resolver using injecting service in constructor
class Characters
{
public $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
public function getHumans()
{
dd($this);
$humans = self::findByType(self::TYPE_HUMAN);
return $humans;
}
}
but when i query this. I always get this error Using $this when not in object context. May i know how can I fix this issue?
in my service.yml. I try this one too
App\Resolver\Characters:
arguments: ['@doctrine.orm.entity_manager']
Metadata
Metadata
Assignees
Labels
No labels
