Skip to content

Commit 1c11ec4

Browse files
authored
docs(class): Add class doc comments (#1136)
1 parent d87160e commit 1c11ec4

63 files changed

Lines changed: 196 additions & 65 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/graphql_example/src/Wrappers/QueryConnection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use Drupal\Core\Entity\Query\QueryInterface;
66
use GraphQL\Deferred;
77

8+
/**
9+
* Helper class that wraps entity queries.
10+
*/
811
class QueryConnection {
912

1013
/**

phpcs.xml.dist

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,66 +17,6 @@
1717
<exclude-pattern>src/GraphQL/ResolverBuilder.php</exclude-pattern>
1818
</rule>
1919

20-
<!-- TODO: those rules are disabled for now until we fix the coding standards for them. -->
21-
<rule ref="Drupal.Commenting.ClassComment.Missing">
22-
<exclude-pattern>src/PermissionProvider.php</exclude-pattern>
23-
<exclude-pattern>src/GraphqlServiceProvider.php</exclude-pattern>
24-
<exclude-pattern>src/RouteProvider.php</exclude-pattern>
25-
<exclude-pattern>src/GraphQL/Resolver/ResolverInterface.php</exclude-pattern>
26-
<exclude-pattern>src/GraphQL/Resolver/SourceContext.php</exclude-pattern>
27-
<exclude-pattern>src/GraphQL/Resolver/Callback.php</exclude-pattern>
28-
<exclude-pattern>src/GraphQL/Resolver/Composite.php</exclude-pattern>
29-
<exclude-pattern>src/GraphQL/Resolver/Argument.php</exclude-pattern>
30-
<exclude-pattern>src/GraphQL/Resolver/Value.php</exclude-pattern>
31-
<exclude-pattern>src/GraphQL/Resolver/Context.php</exclude-pattern>
32-
<exclude-pattern>src/GraphQL/Resolver/ParentValue.php</exclude-pattern>
33-
<exclude-pattern>src/GraphQL/Resolver/Map.php</exclude-pattern>
34-
<exclude-pattern>src/GraphQL/Resolver/Tap.php</exclude-pattern>
35-
<exclude-pattern>src/GraphQL/ResolverRegistryInterface.php</exclude-pattern>
36-
<exclude-pattern>src/GraphQL/Execution/Executor.php</exclude-pattern>
37-
<exclude-pattern>src/GraphQL/Execution/FieldContext.php</exclude-pattern>
38-
<exclude-pattern>src/GraphQL/Execution/ExecutorFactory.php</exclude-pattern>
39-
<exclude-pattern>src/GraphQL/Execution/ExecutionResult.php</exclude-pattern>
40-
<exclude-pattern>src/GraphQL/Execution/ResolveContext.php</exclude-pattern>
41-
<exclude-pattern>src/GraphQL/ResolverBuilder.php</exclude-pattern>
42-
<exclude-pattern>src/GraphQL/Utility/DocumentSerializer.php</exclude-pattern>
43-
<exclude-pattern>src/GraphQL/Utility/Introspection.php</exclude-pattern>
44-
<exclude-pattern>src/GraphQL/Utility/DeferredUtility.php</exclude-pattern>
45-
<exclude-pattern>src/GraphQL/Utility/JsonHelper.php</exclude-pattern>
46-
<exclude-pattern>src/GraphQL/ResolverRegistry.php</exclude-pattern>
47-
<exclude-pattern>src/GraphQL/Buffers/EntityUuidBuffer.php</exclude-pattern>
48-
<exclude-pattern>src/GraphQL/Buffers/EntityBuffer.php</exclude-pattern>
49-
<exclude-pattern>src/Event/OperationEvent.php</exclude-pattern>
50-
<exclude-pattern>src/Access/VoyagerAccessCheck.php</exclude-pattern>
51-
<exclude-pattern>src/Access/ExplorerAccessCheck.php</exclude-pattern>
52-
<exclude-pattern>src/Access/QueryAccessCheck.php</exclude-pattern>
53-
<exclude-pattern>src/Form/PersistedQueriesForm.php</exclude-pattern>
54-
<exclude-pattern>src/EventSubscriber/OperationSubscriber.php</exclude-pattern>
55-
<exclude-pattern>src/EventSubscriber/CurrentLanguageResetTrait.php</exclude-pattern>
56-
<exclude-pattern>src/EventSubscriber/SubrequestSubscriber.php</exclude-pattern>
57-
<exclude-pattern>src/Cache/Context/StaticCacheContext.php</exclude-pattern>
58-
<exclude-pattern>src/Routing/QueryRouteEnhancer.php</exclude-pattern>
59-
<exclude-pattern>src/Entity/ServerInterface.php</exclude-pattern>
60-
<exclude-pattern>src/Plugin/PersistedQueryPluginManager.php</exclude-pattern>
61-
<exclude-pattern>src/Plugin/SchemaExtensionPluginInterface.php</exclude-pattern>
62-
<exclude-pattern>src/Plugin/DataProducerPluginInterface.php</exclude-pattern>
63-
<exclude-pattern>src/Plugin/GraphQL/DataProducer/DataProducerPluginBase.php</exclude-pattern>
64-
<exclude-pattern>src/Plugin/GraphQL/DataProducer/DataProducerPluginCachingTrait.php</exclude-pattern>
65-
<exclude-pattern>src/Plugin/GraphQL/Schema/SdlSchemaPluginBase.php</exclude-pattern>
66-
<exclude-pattern>src/Plugin/GraphQL/SchemaExtension/SdlSchemaExtensionPluginBase.php</exclude-pattern>
67-
<exclude-pattern>src/Plugin/DataProducerPluginManager.php</exclude-pattern>
68-
<exclude-pattern>src/Plugin/PersistedQueryPluginInterface.php</exclude-pattern>
69-
<exclude-pattern>src/Plugin/SchemaPluginInterface.php</exclude-pattern>
70-
<exclude-pattern>src/Plugin/DataProducerPluginCachingInterface.php</exclude-pattern>
71-
<exclude-pattern>src/Controller/RequestController.php</exclude-pattern>
72-
<exclude-pattern>src/SubRequestResponse.php</exclude-pattern>
73-
<exclude-pattern>src/PersistedQuery/PersistedQueryPluginBase.php</exclude-pattern>
74-
<exclude-pattern>examples/graphql_example/src/Wrappers/QueryConnection.php</exclude-pattern>
75-
<exclude-pattern>tests/src/Traits/MockingTrait.php</exclude-pattern>
76-
<exclude-pattern>tests/src/Traits/DataProducerExecutionTrait.php</exclude-pattern>
77-
<exclude-pattern>tests/src/Kernel/GraphQLTestBase.php</exclude-pattern>
78-
</rule>
79-
8020
<rule ref="Drupal.Commenting.DocComment.MissingShort">
8121
<exclude-pattern>src/GraphQL/Resolver/Path.php</exclude-pattern>
8222
<exclude-pattern>src/GraphQL/ResolverRegistryInterface.php</exclude-pattern>

src/Access/ExplorerAccessCheck.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use Drupal\Core\Session\AccountInterface;
88
use Drupal\graphql\Entity\ServerInterface;
99

10+
/**
11+
* Grants access to the GraphQL explorer for admins.
12+
*/
1013
class ExplorerAccessCheck implements AccessInterface {
1114

1215
/**

src/Access/QueryAccessCheck.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Drupal\graphql\Entity\ServerInterface;
99
use Symfony\Component\HttpFoundation\RequestStack;
1010

11+
/**
12+
* Grants access to executing arbitrary GraphQL queries on the defined servers.
13+
*/
1114
class QueryAccessCheck implements AccessInterface {
1215

1316
/**

src/Access/VoyagerAccessCheck.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use Drupal\Core\Session\AccountInterface;
88
use Drupal\graphql\Entity\ServerInterface;
99

10+
/**
11+
* Grants access to the GraphQL voyager for admins.
12+
*/
1013
class VoyagerAccessCheck implements AccessInterface {
1114

1215
/**

src/Cache/Context/StaticCacheContext.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
use Drupal\Core\Cache\CacheableMetadata;
66
use Drupal\Core\Cache\Context\CalculatedCacheContextInterface;
77

8+
/**
9+
* Helper class, not sure for what.
10+
*
11+
* @todo This class and service seems unused, can we remove it?
12+
*/
813
class StaticCacheContext implements CalculatedCacheContextInterface {
914

1015
/**

src/Controller/RequestController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use GraphQL\Server\OperationParams;
99
use Symfony\Component\DependencyInjection\ContainerInterface;
1010

11+
/**
12+
* The main GraphQL request handler that will forward to the responsible server.
13+
*/
1114
class RequestController implements ContainerInjectionInterface {
1215

1316
/**

src/Entity/Server.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
use GraphQL\Validator\DocumentValidator;
2828

2929
/**
30+
* The main GraphQL configuration and request entry point.
31+
*
32+
* Multiple GraphQL servers can be defined on different routing paths with
33+
* different GraphQL schemas.
34+
*
3035
* @ConfigEntityType(
3136
* id = "graphql_server",
3237
* label = @Translation("Server"),

src/Entity/ServerInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
use Drupal\graphql\Plugin\PersistedQueryPluginInterface;
77
use GraphQL\Server\OperationParams;
88

9+
/**
10+
* Defines a GraphQL server that has configuration and executes queries.
11+
*/
912
interface ServerInterface extends ConfigEntityInterface {
1013

1114
/**

src/Event/OperationEvent.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
use GraphQL\Executor\ExecutionResult;
77
use Symfony\Component\EventDispatcher\Event;
88

9+
/**
10+
* Represents an event that is triggered before and after a GraphQL operation.
11+
*/
912
class OperationEvent extends Event {
1013

1114
/**

0 commit comments

Comments
 (0)