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 77 "module" : " build/module/index.js" ,
88 "repository" : " https://github.com/croutonn/graphql-codegen-plugin-typescript-swr" ,
99 "license" : " MIT" ,
10+ "engines" : {
11+ "node" : " >=12.0.0"
12+ },
1013 "keywords" : [
1114 " graphql" ,
1215 " codegen" ,
3639 "@graphql-codegen/plugin-helpers" : " ^2.0.0" ,
3740 "@graphql-codegen/visitor-plugin-common" : " ^2.0.0" ,
3841 "@types/micromatch" : " ^4.0.1" ,
39- "auto-bind" : " ^4.0.0" ,
4042 "graphql-request" : " ^3.4.0" ,
4143 "micromatch" : " ^4.0.4" ,
4244 "pascal-case" : " ^3.1.2" ,
Original file line number Diff line number Diff line change 55 LoadedFragment ,
66 ParsedConfig ,
77} from '@graphql-codegen/visitor-plugin-common'
8- import autoBind from 'auto-bind'
98import { GraphQLSchema , Kind , OperationDefinitionNode } from 'graphql'
109import glob from 'micromatch'
1110import { pascalCase } from 'pascal-case'
@@ -111,8 +110,6 @@ export class SWRVisitor extends ClientSideBaseVisitor<
111110 ( Array . isArray ( this . config . useSWRInfinite ) &&
112111 this . config . useSWRInfinite . length > 0 )
113112
114- autoBind ( this )
115-
116113 const typeImport = this . config . useTypeImports ? 'import type' : 'import'
117114
118115 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:
13061306 resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
13071307 integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
13081308
1309- auto-bind@^4.0.0, auto-bind@ ~4.0.0 :
1309+ auto-bind@~4.0.0 :
13101310 version "4.0.0"
13111311 resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-4.0.0.tgz#e3589fc6c2da8f7ca43ba9f84fa52a744fc997fb"
13121312 integrity sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ==
You can’t perform that action at this time.
0 commit comments