Skip to content

Commit b5f4c1c

Browse files
Vinczmurtukov
andauthored
Apply suggestions from code review
Co-authored-by: Timur Murtukov <[email protected]>
1 parent db06d9e commit b5f4c1c

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

docs/annotations/annotations-reference.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,12 @@ class SecretArea {
381381
## @Mutation
382382

383383
This annotation applies on methods for classes tagged with the `@Provider` annotation. It indicates that the method on this class will resolve a Mutation field.
384-
The corresponding GraphQL field is added to the GraphQL type(s) following the logic :
385-
- The type(s) specified in the `targetType` attribute of the `@Mutation` annotation if it defined.
384+
The corresponding GraphQL field is added to the GraphQL type(s) following the logic:
385+
- The type(s) specified in the `targetType` attribute of the `@Mutation` annotation if it's defined.
386386
or
387-
- The type(s) specified in the `targetTypeMutation` attribute of the `@Provider` annotation if it is defined.
387+
- The type(s) specified in the `targetTypeMutation` attribute of the `@Provider` annotation if it's defined.
388388
or
389-
- The root Query type of the default schema (define in configuration at key `overblog_graphql.definitions.schema.mutation` or `overblog_graphql.definitions.schema.default.mutation`).
389+
- The root Query type of the default schema (defined in configuration at key `overblog_graphql.definitions.schema.mutation` or `overblog_graphql.definitions.schema.default.mutation`).
390390

391391
The class exposing the mutation(s) must be declared as a [service](https://symfony.com/doc/current/service_container.html).
392392

@@ -432,19 +432,19 @@ You can use `@Access` and/or `@IsPublic` on a provider class to add default acce
432432

433433
Optional attributes:
434434

435-
- **prefix** : A prefix to apply to all field names from this provider
436-
- **targetTypeQuery** : The default GraphQL type(s) to attach the provider `@Query` to
437-
- **targetTypeMutation** : The default GraphQL type(s) to attach the provider `@Mutation` to
435+
- **prefix**: A prefix to apply to all field names from this provider
436+
- **targetTypeQuery**: The default GraphQL type(s) to attach the provider `@Query` to
437+
- **targetTypeMutation**: The default GraphQL type(s) to attach the provider `@Mutation` to
438438

439439
## @Query
440440

441441
This annotation applies on methods for classes tagged with the `@Provider` annotation. It indicates that on this class a method will resolve a Query field.
442-
The corresponding GraphQL field is added to the GraphQL type(s) following the logic :
443-
- The type(s) specified in the `targetType` attribute of the `@Query` annotation if it defined.
442+
The corresponding GraphQL field is added to the GraphQL type(s) following the logic:
443+
- The type(s) specified in the `targetType` attribute of the `@Query` annotation if it's defined.
444444
or
445-
- The type(s) specified in the `targetTypeQuery` attribute of the `@Provider` annotation if it is defined.
445+
- The type(s) specified in the `targetTypeQuery` attribute of the `@Provider` annotation if it's defined.
446446
or
447-
- The root Query type of the default schema (define in configuration at key `overblog_graphql.definitions.schema.query` or `overblog_graphql.definitions.schema.default.query`).
447+
- The root Query type of the default schema (defined in configuration at key `overblog_graphql.definitions.schema.query` or `overblog_graphql.definitions.schema.default.query`).
448448

449449
The class exposing the query(ies) must be declared as a [service](https://symfony.com/doc/current/service_container.html).
450450

src/Config/Parser/AnnotationParser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,7 @@ private static function getGraphQLFieldsFromProviders(GraphClass $graphClass, st
715715
if (null === $annotationTargets) {
716716
if ($annotation instanceof GQL\Mutation && isset($providerAnnotation->targetTypeMutation)) {
717717
$annotationTargets = $providerAnnotation->targetTypeMutation;
718-
}
719-
if ($annotation instanceof GQL\Query && isset($providerAnnotation->targetTypeQuery)) {
718+
} elseif ($annotation instanceof GQL\Query && isset($providerAnnotation->targetTypeQuery)) {
720719
$annotationTargets = $providerAnnotation->targetTypeQuery;
721720
}
722721
}

0 commit comments

Comments
 (0)