Skip to content
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

Merged
merged 3 commits into from
Mar 5, 2018

Conversation

mcg-web
Copy link
Member

@mcg-web 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

@mcg-web mcg-web changed the title Fluent resolver use service Fix FluentResolver when tagging two services with same class name Mar 1, 2018
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.
@mcg-web mcg-web force-pushed the fluent-resolver-use-service-id branch from 29b1e94 to 7c887f8 Compare March 1, 2018 07:44
@@ -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
Copy link
Contributor

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)
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize See.

Copy link
Contributor

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)...
Copy link
Contributor

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 …

@mcg-web mcg-web force-pushed the fluent-resolver-use-service-id branch from f1a81b7 to 04e48ae Compare March 5, 2018 13:07
@mcg-web mcg-web requested a review from ooflorent March 5, 2018 13:15
@mcg-web mcg-web merged commit cab67b3 into overblog:master Mar 5, 2018
@mcg-web mcg-web deleted the fluent-resolver-use-service-id branch March 5, 2018 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants