Skip to content

Commit 81fae5a

Browse files
authored
GraphQL v16 Support (#724)
1 parent 2abd74b commit 81fae5a

File tree

26 files changed

+117
-70
lines changed

26 files changed

+117
-70
lines changed

.changeset/green-lions-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': minor
3+
---
4+
5+
GraphQL v16 support

.github/workflows/canary.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
uses: actions/cache@v2
3333
with:
3434
path: '**/node_modules'
35-
key: ${{ runner.os }}-16-node-modules-${{ hashFiles('yarn.lock') }}
35+
key: ${{ runner.os }}-16-8-16-node-modules-${{ hashFiles('yarn.lock') }}
3636
restore-keys: |
37-
${{ runner.os }}-16-node-modules-${{ hashFiles('yarn.lock') }}
38-
${{ runner.os }}-16-node-modules-
37+
${{ runner.os }}-16-8-16-node-modules-${{ hashFiles('yarn.lock') }}
38+
${{ runner.os }}-16-8-16-node-modules-
3939
- name: Install Dependencies using Yarn
4040
run: yarn install && git checkout yarn.lock && yarn patch-package
4141
- name: Release Canary

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
uses: actions/cache@v2
3636
with:
3737
path: '**/node_modules'
38-
key: ${{ runner.os }}-16-node-modules-${{ hashFiles('yarn.lock') }}
38+
key: ${{ runner.os }}-16-8-16-node-modules-${{ hashFiles('yarn.lock') }}
3939
restore-keys: |
40-
${{ runner.os }}-16-node-modules-${{ hashFiles('yarn.lock') }}
41-
${{ runner.os }}-16-node-modules-
40+
${{ runner.os }}-16-8-16-node-modules-${{ hashFiles('yarn.lock') }}
41+
${{ runner.os }}-16-8-16-node-modules-
4242
- name: Install Dependencies using Yarn
4343
run: yarn install && git checkout yarn.lock && yarn patch-package
4444
- name: Create Release Pull Request or Publish to npm

.github/workflows/tests.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,23 @@ jobs:
2525
uses: actions/cache@v2
2626
with:
2727
path: '**/node_modules'
28-
key: ${{ runner.os }}-16-node-modules-${{ hashFiles('yarn.lock') }}
28+
key: ${{ runner.os }}-16-8-16-node-modules-${{ hashFiles('yarn.lock') }}
2929
restore-keys: |
30-
${{ runner.os }}-16-node-modules-${{ hashFiles('yarn.lock') }}
31-
${{ runner.os }}-16-node-modules-
30+
${{ runner.os }}-16-8-16-node-modules-${{ hashFiles('yarn.lock') }}
31+
${{ runner.os }}-16-8-16-node-modules-
3232
- name: Install Dependencies using Yarn
3333
run: yarn install && git checkout yarn.lock
3434
- name: Lint
3535
run: yarn lint
3636
typecheck:
3737
name: TypeScript Type Checking
3838
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
graphql_version:
42+
# - 14
43+
- 15
44+
- 16
3945
steps:
4046
- name: Checkout Master
4147
uses: actions/checkout@v2
@@ -49,10 +55,12 @@ jobs:
4955
uses: actions/cache@v2
5056
with:
5157
path: '**/node_modules'
52-
key: ${{ runner.os }}-16-node-modules-${{ hashFiles('yarn.lock') }}
58+
key: ${{runner.os}}-16-8-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
5359
restore-keys: |
54-
${{ runner.os }}-16-node-modules-${{ hashFiles('yarn.lock') }}
55-
${{ runner.os }}-16-node-modules-
60+
${{runner.os}}-16-8-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
61+
${{runner.os}}-16-8-${{matrix.graphql_version}}-node-modules-
62+
- name: Use GraphQL v${{matrix.graphql_version}}
63+
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
5664
- name: Install Dependencies using Yarn
5765
run: yarn install && git checkout yarn.lock
5866
- name: Build
@@ -64,14 +72,18 @@ jobs:
6472
path: packages/plugin/dist
6573

6674
test:
67-
name: Testing on Node ${{matrix.node_version}} with ESLint v${{matrix.eslint_version}}
75+
name: Testing on Node ${{matrix.node_version}} with ESLint v${{matrix.eslint_version}} and GraphQL v${{matrix.graphql_version}}
6876
timeout-minutes: 60
6977
runs-on: ubuntu-latest
70-
needs: [lint, typecheck]
78+
needs: [typecheck]
7179
strategy:
7280
matrix:
7381
node_version: [12, 16]
7482
eslint_version: [7.32.0, 8]
83+
graphql_version:
84+
# - 14
85+
- 15
86+
- 16
7587
steps:
7688
- name: Checkout Master
7789
uses: actions/checkout@v2
@@ -85,10 +97,12 @@ jobs:
8597
uses: actions/cache@v2
8698
with:
8799
path: '**/node_modules'
88-
key: ${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-node-modules-${{hashFiles('yarn.lock')}}
100+
key: ${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
89101
restore-keys: |
90-
${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-node-modules-${{hashFiles('yarn.lock')}}
91-
${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-node-modules-
102+
${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-${{matrix.graphql_version}}-node-modules-${{hashFiles('yarn.lock')}}
103+
${{runner.os}}-${{matrix.node_version}}-${{matrix.eslint_version}}-${{matrix.graphql_version}}-node-modules-
104+
- name: Use GraphQL v${{matrix.graphql_version}}
105+
run: node ./scripts/match-graphql.js ${{matrix.graphql_version}}
92106
- name: Use ESLint v${{matrix.eslint_version}}
93107
run: node scripts/match-eslint.mjs ${{matrix.eslint_version}}
94108
- name: Install Dependencies using Yarn

.vscode/settings.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
{
2-
"eslint.enable": true
2+
"eslint.enable": true,
3+
"files.exclude": {
4+
"**/.git": true,
5+
"**/.DS_Store": true,
6+
"**/node_modules": true,
7+
"test-lib": true,
8+
"lib": true,
9+
"coverage": true,
10+
"npm": true,
11+
"**/dist": true
12+
},
13+
"typescript.tsdk": "node_modules/typescript/lib"
314
}

babel.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module.exports = {
2-
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
2+
presets: [
3+
['@babel/preset-env', { targets: { node: process.versions.node.split('.')[0] } }],
4+
'@babel/preset-typescript',
5+
],
36
};

examples/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "eslint ."
1010
},
1111
"dependencies": {
12-
"graphql": "15.7.1"
12+
"graphql": "16.0.1"
1313
},
1414
"devDependencies": {
1515
"@graphql-eslint/eslint-plugin": "2.3.2",

examples/code-file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "eslint ."
1010
},
1111
"dependencies": {
12-
"graphql": "15.7.1"
12+
"graphql": "16.0.1"
1313
},
1414
"devDependencies": {
1515
"@graphql-eslint/eslint-plugin": "2.3.2",

examples/graphql-config-code-file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "eslint --ext graphql,js ."
1010
},
1111
"dependencies": {
12-
"graphql": "15.7.1",
12+
"graphql": "16.0.1",
1313
"graphql-tag": "^2.12.5"
1414
},
1515
"devDependencies": {

examples/graphql-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "eslint ."
1010
},
1111
"dependencies": {
12-
"graphql": "15.7.1"
12+
"graphql": "16.0.1"
1313
},
1414
"devDependencies": {
1515
"@graphql-eslint/eslint-plugin": "2.3.2",

0 commit comments

Comments
 (0)