-
Notifications
You must be signed in to change notification settings - Fork 222
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
Can't set a scalar parameter with GraphQL services #410
Comments
Hi! thanks for reporting this issue and the reproduction. We'll try to give this a fix quickly. |
Ok I get it, your service is missing the mutation tag App\GraphQL\Mutation\UploadMutation:
arguments:
$cardUploadDir: '%card_upload_dir%'
tags: ['overblog_graphql.mutation'] |
I'm having the same issue with the tag sadly. |
Can you try to remove |
Hi, what's the status on this bug? I'm using your package and I need to pass entity manager with alternative connection. I'm doing this from services.yaml AppBundle\GraphQL\Mutation\UserMutation:
tags: ['@overblog_graphql.mutation']
arguments:
$em: '@doctrine.orm.user_entity_manager' And when I autowire argument in class __constuct, I get default entity manager. |
This bug was not fixed since this could introduce BC, this come from AliasedInterface usage, removed it and defined your aliases using tags. |
Thanx for quick answer, but it did not help:( mutation class: Class UserMutation implements MutationInterface
{
/**
* @var EntityManagerInterface
*/
protected $em;
public function __construct(EntityManagerInterface $em)
{
\Doctrine\Common\Util\Debug::dump($em->getConnection());die; // here I get default connection
$this->em = $em;
}
public function createUser(array $args): User
{...}
} services.yaml AppBundle\GraphQL\Mutation\UserMutation:
arguments:
$em: '@doctrine.orm.user_entity_manager'
tags:
- { name: overblog_graphql.mutation, method: createUser, alias: createUser } Mutation.yaml Mutation:
type: object
config:
fields:
createUser:
type: User!
resolve: '@=mutation("AppBundle\\GraphQL\\Mutation\\UserMutation::createUser", [args["input"]])'
args:
input:
type: UserInput! |
if you want to use fqcn you must remove alias: AppBundle\GraphQL\Mutation\UserMutation:
arguments:
$em: '@doctrine.orm.user_entity_manager'
tags:
- { name: overblog_graphql.mutation, method: createUser } |
Did not helped, still default connection:( |
Do you have some wildcard rules in your dependency injection configuration? |
I get a quick look at project and not found any wildcards |
Can you name your service app.user_mutation:
class: AppBundle\GraphQL\Mutation\UserMutation:
arguments:
$em: '@doctrine.orm.user_entity_manager'
tags:
- { name: overblog_graphql.mutation, method: createUser } what is the output of this CLI?
|
solution id: It's shown in table, but I don't know how to visualise table, sorry:) |
Hi and thanks for your work !
I think I have encountered a bug in the compiler pass of the bundle. I can't manage to use named parameter with autowiring for my GraphQL services, they are reset somehow.
Reproduction
in
services.yaml
in
App\GraphQL\Mutation\UploadMutation
I always end up with the exception
Temporary fix for me
Quick and dirty fix for me was to override the process function in my kernel.
The text was updated successfully, but these errors were encountered: