File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 7
7
"module" : " build/module/index.js" ,
8
8
"repository" : " https://github.com/croutonn/graphql-codegen-plugin-typescript-swr" ,
9
9
"license" : " MIT" ,
10
+ "engines" : {
11
+ "node" : " >=12.0.0"
12
+ },
10
13
"keywords" : [
11
14
" graphql" ,
12
15
" codegen" ,
36
39
"@graphql-codegen/plugin-helpers" : " ^2.0.0" ,
37
40
"@graphql-codegen/visitor-plugin-common" : " ^2.0.0" ,
38
41
"@types/micromatch" : " ^4.0.1" ,
39
- "auto-bind" : " ^4.0.0" ,
40
42
"graphql-request" : " ^3.4.0" ,
41
43
"micromatch" : " ^4.0.4" ,
42
44
"pascal-case" : " ^3.1.2" ,
Original file line number Diff line number Diff line change 5
5
LoadedFragment ,
6
6
ParsedConfig ,
7
7
} from '@graphql-codegen/visitor-plugin-common'
8
- import autoBind from 'auto-bind'
9
8
import { GraphQLSchema , Kind , OperationDefinitionNode } from 'graphql'
10
9
import glob from 'micromatch'
11
10
import { pascalCase } from 'pascal-case'
@@ -111,8 +110,6 @@ export class SWRVisitor extends ClientSideBaseVisitor<
111
110
( Array . isArray ( this . config . useSWRInfinite ) &&
112
111
this . config . useSWRInfinite . length > 0 )
113
112
114
- autoBind ( this )
115
-
116
113
const typeImport = this . config . useTypeImports ? 'import type' : 'import'
117
114
118
115
this . _additionalImports . push (
Original file line number Diff line number Diff line change
1
+ import { GraphQLSchema } from 'graphql' ;
2
+ import { SWRVisitor } from '../src/visitor'
3
+
4
+ describe ( 'SWRVisitor' , ( ) => {
5
+ describe ( 'sdkContent' , ( ) => {
6
+ it ( 'should export SWRInfiniteKeyLoader' , ( ) => {
7
+ const schema = new GraphQLSchema ( {
8
+ } )
9
+ const visitor = new SWRVisitor (
10
+ schema ,
11
+ [ ] ,
12
+ {
13
+ useSWRInfinite : [ '_query_' ]
14
+ }
15
+ )
16
+ expect ( visitor . sdkContent ) . toContain ( 'export type SWRInfiniteKeyLoader<Data = unknown,' )
17
+ } )
18
+ } )
19
+ } ) ;
Original file line number Diff line number Diff line change @@ -1306,7 +1306,7 @@ asynckit@^0.4.0:
1306
1306
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
1307
1307
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
1308
1308
1309
- auto-bind@^4.0.0, auto-bind@ ~4.0.0 :
1309
+ auto-bind@~4.0.0 :
1310
1310
version "4.0.0"
1311
1311
resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-4.0.0.tgz#e3589fc6c2da8f7ca43ba9f84fa52a744fc997fb"
1312
1312
integrity sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==
You can’t perform that action at this time.
0 commit comments