-
Notifications
You must be signed in to change notification settings - Fork 221
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
Fix FluentResolver when tagging two services with same class name #297
Fix FluentResolver when tagging two services with same class name #297
Conversation
mcg-web
commented
Mar 1, 2018
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | yes |
Deprecations? | no |
Tests pass? | yes |
Documented? | yes |
Fixed tickets | #296 |
License | MIT |
This bug was introduce because we was relying on class name to create FluentResolver id. We now relying on the service id as it is unique.
29b1e94
to
7c887f8
Compare
@@ -15,8 +15,9 @@ Resolvers can be define 2 different ways | |||
or `Overblog\GraphQLBundle\Definition\Resolver\MutationInterface`) | |||
in `src/*Bundle/GraphQL` or `app/GraphQL` and they will be auto discovered. | |||
Auto map classes method are accessible by: | |||
* the class method name (example: `AppBunble\GraphQL\CustomResolver::myMethod`) | |||
* the FQCN for callable classes (example: `AppBunble\GraphQL\InvokeResolver` for a resolver implementing the `__invoke` method) | |||
* double colon (::) to separate service id (class name) and the method names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use double-colon
to match PHP doc
* the class method name (example: `AppBunble\GraphQL\CustomResolver::myMethod`) | ||
* the FQCN for callable classes (example: `AppBunble\GraphQL\InvokeResolver` for a resolver implementing the `__invoke` method) | ||
* double colon (::) to separate service id (class name) and the method names | ||
(example: `AppBunble\GraphQL\CustomResolver::myMethod` or `appbunble\graphql\customresolver::myMethod` for Symfony < 3.3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't talk about the lower case version
@@ -133,7 +134,7 @@ Resolvers can be define 2 different ways | |||
``` | |||
|
|||
**Note:** | |||
* When using FQCN in yaml definition, backslash must be correctly quotes, | |||
* When using service id as FQCN in yaml definition, backslash must be correctly quotes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backslashes must be correctly escaped
@@ -102,7 +102,7 @@ Types can be define 3 different ways: | |||
**Note:** | |||
* Types are lazy loaded so when using Symfony DI `autoconfigure` or this bundle auto mapping, the | |||
only access to type is FQCN (or aliases if implements the aliases interface). | |||
* When using FQCN in yaml definition, backslash must be correctly quotes, | |||
* When using service id as FQCN in yaml definition, backslash must be correctly quotes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backslashes must be correctly escaped
@@ -22,7 +23,7 @@ public function __construct(ResolverResolver $resolver) | |||
], | |||
'resolve' => function ($root, $args) use ($resolver) { | |||
return $resolver->resolve([ | |||
EchoResolver::class, | |||
version_compare(Kernel::VERSION, '3.3.0') < 0 ? strtolower(EchoResolver::class) : EchoResolver::class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
UPGRADE-0.11.md
Outdated
### Change fluent resolvers id | ||
|
||
The use of class name as prefix of fluent resolver id remove the possibility to use same class as 2 different services. | ||
see this [issue for more detail](https://github.com/overblog/GraphQLBundle/issues/296) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize See
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See issue #296 for more detail
UPGRADE-0.11.md
Outdated
|
||
The use of class name as prefix of fluent resolver id remove the possibility to use same class as 2 different services. | ||
see this [issue for more detail](https://github.com/overblog/GraphQLBundle/issues/296) | ||
That the reason from 0.11 we using service id as prefix (like in Symfony 4.1)... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the reason why starting v0.11 we are using …
f1a81b7
to
04e48ae
Compare