Skip to content

Commit 36a012f

Browse files
committed
docs: small fixes
1 parent 139e81f commit 36a012f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ type Subscription {
5757

5858
If you want rename field `articlesList` to `articleList` in your schema just rename `articlesList.ts` file. If you want to add a new field to Schema – just add a new file to `Query`, `Mutation`, `Subscription` folders. **This simple approach helps you understand entrypoints of your schema without launching the GraphQL server – what you see in folders that you get in GraphQL Schema**.
5959

60-
## Describing FieldConfigs in files
60+
## Describing Entrypoints in files
6161

62-
Every FieldConfig definition is described in separate file. This file contains all information about input args, output type, resolve function and additional fields like description & deprecationReason. As an example let's create `schema/Query/sum.ts` and put inside the following content:
62+
Every Entrypoint (FieldConfig definition) is described in separate file. This file contains all information about input args, output type, resolve function and additional fields like description & deprecationReason. As an example let's create `schema/Query/sum.ts` and put inside the following content:
6363

6464
```ts
6565
export default {
@@ -73,12 +73,15 @@ export default {
7373
},
7474
description: 'This method sums two numbers',
7575
deprecationReason: 'This method is deprecated and will be removed soon.',
76+
extensions: {
77+
someExtraParam: 'Can be used for AST transformers',
78+
},
7679
};
7780
```
7881

7982
If you familiar with [graphql-js FieldConfig definition](https://graphql.org/graphql-js/type/#examples) then you may notice that `type` & `args` properties are defined in SDL format. This syntax sugar provided by [graphql-compose](https://github.com/graphql-compose/graphql-compose#examples) package.
8083

81-
## Namespaces for big schemas
84+
## Entrypoints with namespaces for big schemas
8285

8386
If your GraphQL Schema has a lot of methods you may create sub-folders for grouping some entrypoints fields according to some Entity or Namespace:
8487

0 commit comments

Comments
 (0)