File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,17 @@ export class ModuleCache<K, T> {
8
8
map = new Map < K , { lastSeen : [ number , number ] ; result : T } > ( ) ;
9
9
10
10
set ( cacheKey : K , result : T ) : void {
11
+ // Remove server-side cache code in browser
12
+ if ( typeof window !== 'undefined' ) return ;
13
+
11
14
this . map . set ( cacheKey , { lastSeen : process . hrtime ( ) , result } ) ;
12
15
log ( 'setting entry for' , cacheKey ) ;
13
16
}
14
17
15
18
get ( cacheKey : K , settings = { lifetime : 10 /* seconds */ } ) : T | void {
19
+ // Remove server-side cache code in browser
20
+ if ( typeof window !== 'undefined' ) return ;
21
+
16
22
const value = this . map . get ( cacheKey ) ;
17
23
if ( ! value ) {
18
24
log ( 'cache miss for' , cacheKey ) ;
Original file line number Diff line number Diff line change @@ -163,10 +163,10 @@ export function PlayPage(): ReactElement {
163
163
documents = { operation }
164
164
selectedRules = { {
165
165
// @ts -expect-error -- TODO: fix type error
166
- ...( schemaConfig && configs [ `flat/${ schemaConfig } ` ] . rules ) ,
166
+ ...( schemaConfig && configs [ `flat/${ schemaConfig } ` ] ) ,
167
167
...( schemaRule && {
168
168
[ `@graphql-eslint/${ schemaRule } ` ] :
169
- configs [ 'flat/schema-all' ] . rules [ `@graphql-eslint/${ schemaRule } ` ] ,
169
+ configs [ 'flat/schema-all' ] [ `@graphql-eslint/${ schemaRule } ` ] ,
170
170
} ) ,
171
171
} }
172
172
onChange = { setSchema }
@@ -179,10 +179,10 @@ export function PlayPage(): ReactElement {
179
179
documents = { operation }
180
180
selectedRules = { {
181
181
// @ts -expect-error -- TODO: fix type error
182
- ...( operationConfig && configs [ `flat/${ operationConfig } ` ] . rules ) ,
182
+ ...( operationConfig && configs [ `flat/${ operationConfig } ` ] ) ,
183
183
...( operationRule && {
184
184
[ `@graphql-eslint/${ operationRule } ` ] :
185
- configs [ 'flat/operations-all' ] . rules [ `@graphql-eslint/${ operationRule } ` ] ,
185
+ configs [ 'flat/operations-all' ] [ `@graphql-eslint/${ operationRule } ` ] ,
186
186
} ) ,
187
187
} }
188
188
onChange = { setOperation }
You can’t perform that action at this time.
0 commit comments