Skip to content

Commit b37fd9e

Browse files
authored
style(cspell): Fix misspelled words (#1416)
1 parent b677475 commit b37fd9e

21 files changed

+40
-30
lines changed

.cspell-project-words.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dataproducer
2+
dataproducers
3+
GraphiQL
4+
graphqls
5+
webonyx

doc/mutations/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ input ArticleInput {
2929
}
3030
```
3131

32-
And now in our `.exntends.graphqls` file we will extend the Mutation type to add our new mutation. This is so that in the future other modules can also themselves extend this type with new mutations keeping things organized.
32+
And now in our `.extends.graphqls` file we will extend the Mutation type to add our new mutation. This is so that in the future other modules can also themselves extend this type with new mutations keeping things organized.
3333

3434
```
3535
extend type Mutation {
@@ -137,10 +137,10 @@ class CreateArticle extends DataProducerPluginBase implements ContainerFactoryPl
137137
}
138138
```
139139

140-
### Important note
140+
### Important note
141141

142142
One thing to notice when creating mutations like this is that Access checking needs to be done in the mutation, for queries this usually is done in the
143-
data producer directly (e.g. `entity_load` has access checking built-in) but because we are programatically creating
143+
data producer directly (e.g. `entity_load` has access checking built-in) but because we are programmatically creating
144144
things we need to check the user actually has access to do the operation.
145145

146146
## Calling the mutation

doc/mutations/validations.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ We define a Violation scalar which will just hold the error messages that will b
4949

5050
## Create the ArticleResponse class
5151

52-
Because we need adition content inside our Response we make a class that implements the module's ResponseInterface. Inside it will have a `article` property (like we saw before). This will be added in the `src/Wrappers/Response` folder and we will call it `ArticleResponse.php`
52+
Because we need additional content inside our Response we make a class that implements the module's ResponseInterface. Inside it will have a `article` property (like we saw before). This will be added in the `src/Wrappers/Response` folder and we will call it `ArticleResponse.php`
5353

5454
```php
5555

@@ -207,7 +207,7 @@ We have added a new type that is returned `$response` where we call the `setArti
207207

208208
## Resolve errors and article
209209

210-
To resolve our fields similar to before we go to our schema implementation again and add the resolvers for the
210+
To resolve our fields similar to before we go to our schema implementation again and add the resolvers for the
211211
`ArticleResponse` we created (what the mutation now returns back):
212212

213213
```php
@@ -232,7 +232,7 @@ public function registerResolvers(ResolverRegistryInterface $registry) {
232232
}
233233
```
234234

235-
And that's it if we now call this mutation for example as an anonymous user (if we set aribtrary queries enabled in the permissions for the module) we should get an error :
235+
And that's it if we now call this mutation for example as an anonymous user (if we set arbitrary queries enabled in the permissions for the module) we should get an error :
236236

237237
```json
238238
{

doc/producers/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ The 4.x version of the Drupal GraphQL module is built on top of a concept called
44

55
A data producer is more or less a function that takes arguments (either from an end user query or static) and resolves these into some other data, for example taking an entity (such as a node) and giving back a particular field.
66

7-
Lets imagine we want to make a custom field available for a schema, in this case we have an `author` field in the "Article" content type. For this field we can have a producer that takes an entity and returns or resolves the creator field. Let's apply this to our custom schema which alreay defines an "Article" type.
7+
Lets imagine we want to make a custom field available for a schema, in this case we have an `author` field in the "Article" content type. For this field we can have a producer that takes an entity and returns or resolves the creator field. Let's apply this to our custom schema which already defines an "Article" type.
88

99
## Add the field to the schema
1010

11-
In your `.graphqls` file add the schema defintion
11+
In your `.graphqls` file add the schema definition
1212

1313
```
1414
type Article {
@@ -44,7 +44,7 @@ $registry->addFieldResolver('Article', 'author',
4444
)
4545
);
4646
```
47-
Now you can make a sample article (as a user) and if you now go over to your graphql explorer and run the following query :
47+
Now you can make a sample article (as a user) and if you now go over to your graphql explorer and run the following query :
4848

4949
```
5050
{
@@ -54,9 +54,9 @@ Now you can make a sample article (as a user) and if you now go over to your gra
5454
author
5555
}
5656
}
57-
```
57+
```
5858

59-
You should get a response in the same format e.g. :
59+
You should get a response in the same format e.g. :
6060

6161
```json
6262
{
@@ -68,11 +68,11 @@ You should get a response in the same format e.g. :
6868
}
6969
}
7070
}
71-
```
71+
```
7272

7373
### Resolver builder
7474

75-
You need to initalize the `ResolverBuilder` once inside the `registerResolvers` method (or `getResolverRegistry` if you do not want to use schema extensions) in order to start registering resolvers. This is what will give you access to all the data producers by calling the `produce` method which takes as a parameter the data producer id.
75+
You need to initialize the `ResolverBuilder` once inside the `registerResolvers` method (or `getResolverRegistry` if you do not want to use schema extensions) in order to start registering resolvers. This is what will give you access to all the data producers by calling the `produce` method which takes as a parameter the data producer id.
7676

7777
Essentially calling the `produce` method with the data producer id is what you need to do every time you want to make a field available in the schema. We tell Drupal where and how to get the data and specify where this maps to.
7878

doc/producers/composing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $registry->addFieldResolver('Query', 'currentUser', $builder->compose(
2626
->map('type', $builder->fromValue('user'))
2727
->map('id', $builder->fromParent()),
2828
$builder->callback(function ($entity) {
29-
// Here we can do anything we want to the data. We get as a parameter anyting that was returned
29+
// Here we can do anything we want to the data. We get as a parameter anything that was returned
3030
// in the previous step.
3131
})
3232
));

doc/producers/custom.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Now that we have this we need to make a resolver that actually loads this user,
2626
```php
2727
<?php
2828

29-
namespace Drupal\mydrupalgql\Plugin\GraphQL\DataProducer;
29+
namespace Drupal\example\Plugin\GraphQL\DataProducer;
3030

3131
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
3232
use Drupal\Core\Session\AccountInterface;

doc/starting/custom-schema.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ This is the main entry point for your schema. You can insert new types, inputs a
2020

2121
For now all you need to know about this file is that it extends the base file. What this will allow is to better organize resolvers into different modules where each module might expose different things to the schema. The only existing type by default is `Query` and so to define new queries you have to add them here in the extension.graphqls file.
2222

23-
For more information about composable schemas go to [Advanced section](./../advanced/composable-schemas.md) when talking about spliting schemas so that you can make certain modules enable new functionalities as they are enabled.
23+
For more information about composable schemas go to [Advanced section](./../advanced/composable-schemas.md) when talking about splitting schemas so that you can make certain modules enable new functionalities as they are enabled.
2424

2525
### Plugins
2626

2727
The module also includes some Plugins which are required inside the folder `src/Plugin/GraphQL/Schema` and optionally `src/Plugin/GraphQL/SchemaExtension`:
2828

29-
- ComposableSchemaExample.php : This file will define the schema itself. You can register default resolvers and also regular resolvers here. If you don't have a particular need you don't really need anything more than the anotation for your schema at first. Later with more complex examples we will show how it can be useful to add some base functionality (automatic resolvers or default resolvers).
30-
- ComposableGraphQLSchemaExtension.php : This file will be used to implement resolvers in a way that is composeable (recommended). We recommend having at least one of these, but you can also implement resolvers across multiple modules by including several schema extensions in each module that exposes certain functionality to the schema when enabled. See the [Advanced section](./../advanced/composable-schemas.md) when talking about spliting schemas.
29+
- ComposableSchemaExample.php : This file will define the schema itself. You can register default resolvers and also regular resolvers here. If you don't have a particular need you don't really need anything more than the annotation for your schema at first. Later with more complex examples we will show how it can be useful to add some base functionality (automatic resolvers or default resolvers).
30+
- ComposableGraphQLSchemaExtension.php : This file will be used to implement resolvers in a way that is composable (recommended). We recommend having at least one of these, but you can also implement resolvers across multiple modules by including several schema extensions in each module that exposes certain functionality to the schema when enabled. See the [Advanced section](./../advanced/composable-schemas.md) when talking about splitting schemas.
3131

3232
#### Note
3333

src/Controller/VoyagerController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Symfony\Component\DependencyInjection\ContainerInterface;
99

1010
/**
11-
* Controller for the GraphQL Voyager visualisation API.
11+
* Controller for the GraphQL Voyager visualization API.
1212
*
1313
* @codeCoverageIgnore
1414
*/

src/GraphQL/Execution/ExecutionResult.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use GraphQL\Executor\ExecutionResult as LibraryExecutionResult;
88

99
/**
10-
* Expand the upstream ExecutionResult to make it Drupal cachable.
10+
* Expand the upstream ExecutionResult to make it Drupal cacheable.
1111
*/
1212
class ExecutionResult extends LibraryExecutionResult implements CacheableDependencyInterface {
1313
use RefinableCacheableDependencyTrait;

src/GraphQL/Validator.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ public function getMissingResolvers(ServerInterface $server, array $ignore_types
6464

6565
if (!method_exists($resolver_registry, "getFieldResolverWithInheritance")) {
6666
$this->logger->warning(
67-
"Could not get missing resolvers for @server_name as its registry class (@klass) does not implement getFieldResolverWithInheritance.",
67+
"Could not get missing resolvers for @server_name as its registry class (@class) does not implement getFieldResolverWithInheritance.",
6868
[
6969
'@server_name' => $server->id(),
70-
'@klass' => get_class($resolver_registry),
70+
'@class' => get_class($resolver_registry),
7171
]
7272
);
7373
return [];
@@ -130,10 +130,10 @@ public function getOrphanedResolvers(ServerInterface $server, array $ignore_type
130130

131131
if (!method_exists($resolver_registry, "getAllFieldResolvers")) {
132132
$this->logger->warning(
133-
"Could not get orphaned resolvers for @server_name as its registry class (@klass) does not implement getAllFieldResolvers.",
133+
"Could not get orphaned resolvers for @server_name as its registry class (@class) does not implement getAllFieldResolvers.",
134134
[
135135
'@server_name' => $server->id(),
136-
'@klass' => get_class($resolver_registry),
136+
'@class' => get_class($resolver_registry),
137137
]
138138
);
139139
return [];

src/Plugin/DataProducerPluginCachingInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Drupal\graphql\Plugin;
44

55
/**
6-
* Defines cachable data producer plugins.
6+
* Defines a cacheable data producer plugins.
77
*/
88
interface DataProducerPluginCachingInterface extends DataProducerPluginInterface {
99

src/Plugin/GraphQL/DataProducer/String/Uppercase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* name = @Translation("Uppercase"),
1313
* description = @Translation("Transforms a string to uppercase."),
1414
* produces = @ContextDefinition("string",
15-
* label = @Translation("Uppercased string")
15+
* label = @Translation("Uppercase converted string")
1616
* ),
1717
* consumes = {
1818
* "string" = @ContextDefinition("string",

src/Plugin/GraphQL/DataProducer/Taxonomy/TaxonomyLoadTree.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function __construct(
126126
* Resolves the taxonomy tree for given vocabulary.
127127
*
128128
* @param string $vid
129-
* The vocanulary ID.
129+
* The vocabulary ID.
130130
* @param int $parent
131131
* The ID of the parent's term to load the tree for.
132132
* @param int|null $max_depth
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type: module
22
name: GraphQL Alterable Schema Test
3-
description: Tests if alterting schema is working.
3+
description: Tests if altering the schema is working.
44
package: Testing
55
hidden: TRUE

tests/src/Kernel/DataProducer/EntityReferenceTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function setUp(): void {
4848
]);
4949
$content_type2->save();
5050

51-
$this->createEntityReferenceField('node', 'test1', 'field_test1_to_test2', 'test1 lable', 'node', 'default', [], FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
51+
$this->createEntityReferenceField('node', 'test1', 'field_test1_to_test2', 'test1 label', 'node', 'default', [], FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
5252

5353
$this->referencedNode = Node::create([
5454
'title' => 'Dolor2',

tests/src/Kernel/DataProducer/EntityTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public function setUp(): void {
8787
]);
8888
$content_type->save();
8989

90+
// cspell:ignore otherbundle
9091
$content_type = NodeType::create([
9192
'type' => 'otherbundle',
9293
'name' => 'otherbundle',

tests/src/Kernel/DataProducer/RoutingTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public function testUrlPath(): void {
139139
*/
140140
public function testUrlNotFound(): void {
141141
$result = $this->executeDataProducer('route_load', [
142+
// cspell:ignore idontexist
142143
'path' => '/idontexist',
143144
]);
144145

tests/src/Kernel/Framework/PersistedQueriesTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected function setUp(): void {
4343
$this->mockResolver('Query', 'field_two', 'this is the field two');
4444
$this->mockResolver('Query', 'field_three', []);
4545
$this->mockResolver('Link', 'url', 'https://www.ecosia.org');
46+
// cspell:ignore Ecosia
4647
$this->mockResolver('Link', 'title', 'Ecosia');
4748
}
4849

tests/src/Kernel/Framework/TestFrameworkTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public function testFieldMock(): void {
6363
* Test result error assertions.
6464
*/
6565
public function testErrorAssertion(): void {
66+
// cspell:ignore wrongname
6667
$schema = <<<GQL
6768
type Query {
6869
wrongname: String

tests/src/Kernel/ResolverRegistryTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class ResolverRegistryTest extends GraphQLTestBase {
1919
public function setUp(): void {
2020
parent::setUp();
2121

22+
// cspell:ignore Cabrio cabrio
2223
$schema = <<<GQL
2324
type Query {
2425
transportation: Vehicle

tests/src/Traits/QueryResultAssertionTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private function assertResultData(ExecutionResult $result, $expected): void {
165165
* @internal
166166
*/
167167
private function assertResultErrors(ExecutionResult $result, array $expected): void {
168-
// Initalize the status.
168+
// Initialize the status.
169169
$unexpected = [];
170170
$matchCount = array_fill_keys($expected, 0);
171171

0 commit comments

Comments
 (0)