Skip to content

Commit 50b8228

Browse files
authored
update for graphql v16
1 parent 48852d9 commit 50b8228

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"graphql": "<17.0.0"
3434
},
3535
"dependencies": {
36-
"@graphql-codegen/plugin-helpers": "^2.0.0",
37-
"@graphql-codegen/visitor-plugin-common": "^2.0.0",
36+
"@graphql-codegen/plugin-helpers": "^2.3.1",
37+
"@graphql-codegen/visitor-plugin-common": "^2.5.1",
3838
"@types/micromatch": "^4.0.1",
3939
"auto-bind": "^4.0.0",
4040
"graphql-request": "^3.4.0",

src/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ import {
44
Types,
55
PluginValidateFn,
66
PluginFunction,
7+
oldVisit,
78
} from '@graphql-codegen/plugin-helpers'
89
import { LoadedFragment } from '@graphql-codegen/visitor-plugin-common'
9-
import {
10-
visit,
11-
GraphQLSchema,
12-
concatAST,
13-
Kind,
14-
FragmentDefinitionNode,
15-
} from 'graphql'
10+
import { GraphQLSchema, concatAST, Kind, FragmentDefinitionNode } from 'graphql'
1611

1712
import { RawSWRPluginConfig } from './config'
1813
import { SWRVisitor } from './visitor'
@@ -38,7 +33,7 @@ export const plugin: PluginFunction<RawSWRPluginConfig> = (
3833
]
3934

4035
const visitor = new SWRVisitor(schema, allFragments, config)
41-
visit(allAst, { leave: visitor })
36+
oldVisit(allAst, { leave: visitor })
4237
return {
4338
prepend: visitor.getImports(),
4439
content: visitor.sdkContent,

yarn.lock

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@
572572
tslib "~2.0.0"
573573
upper-case "2.0.1"
574574

575-
"@graphql-codegen/plugin-helpers@^2.0.0", "@graphql-codegen/plugin-helpers@^2.3.0":
575+
"@graphql-codegen/plugin-helpers@^2.3.0", "@graphql-codegen/plugin-helpers@^2.3.1":
576576
version "2.3.1"
577577
resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.3.1.tgz#b66c742d3209a85bc2f72f9e2eceb6b08fc81f85"
578578
integrity sha512-rWH7igcjYqZ6rqNFTb4Wyp31863fRmmVpsRN8VHzBCltrepOO97jwTwB93aAw+T6Dm8aZto3QFfDIC79u8wA2Q==
@@ -636,7 +636,7 @@
636636
auto-bind "~4.0.0"
637637
tslib "~2.3.0"
638638

639-
"@graphql-codegen/visitor-plugin-common@2.5.0", "@graphql-codegen/visitor-plugin-common@^2.0.0":
639+
"@graphql-codegen/visitor-plugin-common@2.5.0":
640640
version "2.5.0"
641641
resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.5.0.tgz#e412fade4ca3178a19e7ea122a4cb3463f2bf585"
642642
integrity sha512-a1kJ/5YBivCj9X20YuhNU2mPY9xjUVmJO0VjHBu06PyvC27GsR1PmvgRALIXrb6QwV+9DDUda3ewKzgne2Qc+A==
@@ -652,6 +652,22 @@
652652
parse-filepath "^1.0.2"
653653
tslib "~2.3.0"
654654

655+
"@graphql-codegen/visitor-plugin-common@^2.5.1":
656+
version "2.5.1"
657+
resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.5.1.tgz#4401bc401ff501b9b9330d1681e64685f519b327"
658+
integrity sha512-hLnVB6u7qB1rIh9oJnGVWQmrUsXw3nEUMF+LGdf4b5qEWh5f9HSzciWMS6M47h4fSqpLyW4qgk2glH/DKwFgRA==
659+
dependencies:
660+
"@graphql-codegen/plugin-helpers" "^2.3.0"
661+
"@graphql-tools/optimize" "^1.0.1"
662+
"@graphql-tools/relay-operation-optimizer" "^6.3.7"
663+
"@graphql-tools/utils" "^8.3.0"
664+
auto-bind "~4.0.0"
665+
change-case-all "1.0.14"
666+
dependency-graph "^0.11.0"
667+
graphql-tag "^2.11.0"
668+
parse-filepath "^1.0.2"
669+
tslib "~2.3.0"
670+
655671
"@graphql-tools/optimize@^1.0.1":
656672
version "1.1.1"
657673
resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-1.1.1.tgz#dcd59ba1ee34431e5e9b086b57fe0bdb1a176669"

0 commit comments

Comments
 (0)