@graphql-eslint/eslint-plugin 2.4.0-alpha-0617395.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,7 +58,7 @@ This is useful if you wish to use other GraphQL tools that works with the origin
58
58
  Here's an example for using original `graphql-js` validate method to validate `OperationDefinition`:
59
59
 
60
60
  ```ts
61
- import { validate } from 'graphql-js';
61
+ import { validate } from 'graphql';
62
62
  import { requireGraphQLSchemaFromContext } from '@graphql-eslint/eslint-plugin';
63
63
 
64
64
  export const rule = {
@@ -14,11 +14,11 @@ Checks for duplicate fields in selection set, variables in operation definition,
14
14
  ```graphql
15
15
  # eslint @graphql-eslint/avoid-duplicate-fields: 'error'
16
16
 
17
- query getUserDetails {
17
+ query {
18
18
  user {
19
- name # first
19
+ name
20
20
  email
21
- name # second
21
+ name # duplicate field
22
22
  }
23
23
  }
24
24
  ```
@@ -28,7 +28,7 @@ query getUserDetails {
28
28
  ```graphql
29
29
  # eslint @graphql-eslint/avoid-duplicate-fields: 'error'
30
30
 
31
- query getUsers {
31
+ query {
32
32
  users(
33
33
  first: 100
34
34
  skip: 50
@@ -45,9 +45,11 @@ query getUsers {
45
45
  ```graphql
46
46
  # eslint @graphql-eslint/avoid-duplicate-fields: 'error'
47
47
 
48
- query getUsers($first: Int!, $first: Int!) {
49
- # Duplicate variable
50
- users(first: 100, skip: 50, after: "cji629tngfgou0b73kt7vi5jo") {
48
+ query (
49
+ $first: Int!
50
+ $first: Int! # duplicate variable
51
+ ) {
52
+ users(first: $first, skip: 50) {
51
53
  id
52
54
  }
53
55
  }
@@ -13,5 +13,5 @@ Fragments use a type condition to determine if they apply, since fragments can o
13
13
 
14
14
  ## Resources
15
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)
16
+ - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/FragmentsOnCompositeTypesRule.ts)
17
+ - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/FragmentsOnCompositeTypesRule-test.ts)
@@ -13,5 +13,5 @@ A GraphQL subscription is valid only if it contains a single root field.
13
13
 
14
14
  ## Resources
15
15
 
16
- - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/OneFieldSubscriptionsRule.ts)
17
- - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/OneFieldSubscriptionsRule-test.ts)
16
+ - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/SingleFieldSubscriptionsRule.ts)
17
+ - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/SingleFieldSubscriptionsRule-test.ts)
@@ -13,5 +13,5 @@ A fragment spread is only valid if the type condition could ever possibly be tru
13
13
 
14
14
  ## Resources
15
15
 
16
- - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleFragmentSpreadRule.ts)
17
- - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/PossibleFragmentSpreadRule-test.ts)
16
+ - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleFragmentSpreadsRule.ts)
17
+ - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/PossibleFragmentSpreadsRule-test.ts)
@@ -13,5 +13,5 @@ A type extension is only valid if the type is defined and has the same kind.
13
13
 
14
14
  ## Resources
15
15
 
16
- - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleTypeExtensionRule.ts)
17
- - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/PossibleTypeExtensionRule-test.ts)
16
+ - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/PossibleTypeExtensionsRule.ts)
17
+ - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/PossibleTypeExtensionsRule-test.ts)
@@ -13,5 +13,5 @@ A GraphQL document is only valid if all non-repeatable directives at a given loc
13
13
 
14
14
  ## Resources
15
15
 
16
- - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueDirectiveNamesPerLocationRule.ts)
17
- - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueDirectiveNamesPerLocationRule-test.ts)
16
+ - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/UniqueDirectivesPerLocationRule.ts)
17
+ - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/UniqueDirectivesPerLocationRule-test.ts)
@@ -13,5 +13,5 @@ A GraphQL document is only valid if all value literals are of the type expected
13
13
 
14
14
  ## Resources
15
15
 
16
- - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ValueLiteralsOfCorrectTypeRule.ts)
17
- - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/ValueLiteralsOfCorrectTypeRule-test.ts)
16
+ - [Rule source](https://github.com/graphql/graphql-js/blob/main/src/validation/rules/ValuesOfCorrectTypeRule.ts)
17
+ - [Test source](https://github.com/graphql/graphql-js/tree/main/src/validation/__tests__/ValuesOfCorrectTypeRule-test.ts)