Skip to content

Commit 6752de4

Browse files
fix(): minor improvements
1 parent 854b3c1 commit 6752de4

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

content/graphql/resolvers-map.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ We can define multiple `@Query()` resolver functions (both within this class, an
167167
In the above examples, the `@Query()` decorator generates a GraphQL schema query type name based on the method name. For example, consider the following construction from the example above:
168168

169169
```typescript
170-
@Query(returns => Author)
171-
async author(@Args({ name: 'id', type: () => Int }) id: number) {
172-
return this.authorsService.findOneById(id);
173-
}
170+
@Query(returns => Author)
171+
async author(@Args({ name: 'id', type: () => Int }) id: number) {
172+
return this.authorsService.findOneById(id);
173+
}
174174
```
175175

176176
This generates the following entry for the author query in our schema (the query type uses the same name as the method name):
@@ -356,10 +356,10 @@ In this case (`@Resolver()` decorator at the method level), if you have multiple
356356
In the above examples, the `@Query()` and `@ResolveField()` decorators are associated with GraphQL schema types based on the method name. For example, consider the following construction from the example above:
357357

358358
```typescript
359-
@Query()
360-
async author(@Args('id') id: number) {
361-
return this.authorsService.findOneById(id);
362-
}
359+
@Query()
360+
async author(@Args('id') id: number) {
361+
return this.authorsService.findOneById(id);
362+
}
363363
```
364364

365365
This generates the following entry for the author query in our schema (the query type uses the same name as the method name):
@@ -510,7 +510,7 @@ The GraphQL plugin will automatically:
510510
- set the `nullable` property depending on the question mark (e.g. `name?: string` will set `nullable: true`)
511511
- set the `type` property depending on the type (supports arrays as well)
512512

513-
Please, note that your filenames **must have** one of the following suffixes in order to be analyzed by the plugin: `['.input.ts', '.args.ts', '.entity.ts']` (e.g., `author.entity.ts`). If you are using a different suffix, you can adjust the plugin's behavior by specifying the `typeFileNameSuffix` option (see below).
513+
Please, note that your filenames **must have** one of the following suffixes in order to be analyzed by the plugin: `['.input.ts', '.args.ts', '.entity.ts', '.model.ts']` (e.g., `author.entity.ts`). If you are using a different suffix, you can adjust the plugin's behavior by specifying the `typeFileNameSuffix` option (see below).
514514

515515
With what we've learned so far, you have to duplicate a lot of code to let the package know how your type should be declared in GraphQL. For example, you could define a simple `Author` class as follows:
516516

@@ -593,7 +593,7 @@ export interface PluginOptions {
593593
</tr>
594594
<tr>
595595
<td><code>typeFileNameSuffix</code></td>
596-
<td><code>['.input.ts', '.args.ts', '.entity.ts']</code></td>
596+
<td><code>['.input.ts', '.args.ts', '.entity.ts', '.model.ts']</code></td>
597597
<td>GraphQL types files suffix</td>
598598
</tr>
599599
</table>

src/scss/hljs.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
border-top-right-radius: 6px;
1111
overflow: hidden;
1212
font-size: 15px;
13+
letter-spacing: 0.3px;
1314
}
1415

1516
.filename + pre[class*='language-'],

0 commit comments

Comments
 (0)