Skip to content

Commit 4f02301

Browse files
author
Dimitri POSTOLOV
authored
docs: add links to rule source and test source (#723)
1 parent c42cee5 commit 4f02301

File tree

59 files changed

+386
-75
lines changed

Some content is hidden

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

59 files changed

+386
-75
lines changed

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ Name            &nbs
7373

7474
- [Writing Custom Rules](custom-rules.md)
7575
- [How the parser works?](parser.md)
76-
- [`parserOptions`](parser-options.md)
76+
- [`parserOptions`](parser-options.md)

docs/rules/alphabetize.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,9 @@ The elements of the array must contain the following properties:
137137
- `FieldDefinition`
138138
- `Field`
139139
- `DirectiveDefinition`
140-
- `Directive`
140+
- `Directive`
141+
142+
## Resources
143+
144+
- [Rule source](../../packages/plugin/src/rules/alphabetize.ts)
145+
- [Test source](../../packages/plugin/tests/alphabetize.spec.ts)

docs/rules/avoid-duplicate-fields.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,9 @@ query getUsers($first: Int!, $first: Int!) {
5151
id
5252
}
5353
}
54-
```
54+
```
55+
56+
## Resources
57+
58+
- [Rule source](../../packages/plugin/src/rules/avoid-duplicate-fields.ts)
59+
- [Test source](../../packages/plugin/tests/avoid-duplicate-fields.spec.ts)

docs/rules/avoid-operation-name-prefix.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ The object is an array with all elements of the type `string`.
4343

4444
Additional restrictions:
4545

46-
* Minimum items: `1`
46+
* Minimum items: `1`
47+
48+
## Resources
49+
50+
- [Rule source](../../packages/plugin/src/rules/avoid-operation-name-prefix.ts)

docs/rules/avoid-scalar-result-type-on-mutation.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ type Mutation {
2727
type Mutation {
2828
createUser: User!
2929
}
30-
```
30+
```
31+
32+
## Resources
33+
34+
- [Rule source](../../packages/plugin/src/rules/avoid-scalar-result-type-on-mutation.ts)
35+
- [Test source](../../packages/plugin/tests/avoid-scalar-result-type-on-mutation.spec.ts)

docs/rules/avoid-typename-prefix.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@ type User {
2929
type User {
3030
id: ID!
3131
}
32-
```
32+
```
33+
34+
## Resources
35+
36+
- [Rule source](../../packages/plugin/src/rules/avoid-typename-prefix.ts)
37+
- [Test source](../../packages/plugin/tests/avoid-typename-prefix.spec.ts)

docs/rules/description-style.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@ This element must be one of the following enum values:
4242
* `block`
4343
* `inline`
4444

45-
Default: `"inline"`
45+
Default: `"inline"`
46+
47+
## Resources
48+
49+
- [Rule source](../../packages/plugin/src/rules/description-style.ts)
50+
- [Test source](../../packages/plugin/tests/description-style.spec.ts)

docs/rules/executable-definitions.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@
99

1010
A GraphQL document is only valid for execution if all definitions are either operation or fragment definitions.
1111

12-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ExecutableDefinitionsRule.ts).
12+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ExecutableDefinitionsRule.ts).
13+
14+
## Resources
15+
16+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ExecutableDefinitionsRule.ts)
17+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/ExecutableDefinitionsRule-test.ts)

docs/rules/fields-on-correct-type.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@
99

1010
A GraphQL document is only valid if all fields selected are defined by the parent type, or are an allowed meta field such as `__typename`.
1111

12-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/FieldsOnCorrectTypeRule.ts).
12+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/FieldsOnCorrectTypeRule.ts).
13+
14+
## Resources
15+
16+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/FieldsOnCorrectTypeRule.ts)
17+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/FieldsOnCorrectTypeRule-test.ts)

docs/rules/fragments-on-composite-type.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@
99

1010
Fragments use a type condition to determine if they apply, since fragments can only be spread into a composite type (object, interface, or union), the type condition must also be a composite type.
1111

12-
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/FragmentsOnCompositeTypesRule.ts).
12+
> This rule is a wrapper around a `graphql-js` validation function. [You can find its source code here](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/FragmentsOnCompositeTypesRule.ts).
13+
14+
## Resources
15+
16+
- [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/FragmentsOnCompositeTypeRule.ts)
17+
- [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/FragmentsOnCompositeTypeRule-test.ts)

0 commit comments

Comments
 (0)