Skip to content

Commit 24f19d6

Browse files
committed
add comments
1 parent b641982 commit 24f19d6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/development.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ import type { Constructor } from './jsutils/instanceOf.js';
33
import { symbolForGraphQLInstanceOfCheck } from './jsutils/instanceOf.js';
44

55
/**
6-
* A replacement for instanceof which includes an error warning when multi-realm
7-
* constructors are detected.
6+
* An additional check to be included within instanceOf warning when
7+
* multi-realm constructors are detected.
8+
*
9+
* This additional check will be included:
10+
* 1. if 'graphql/development.js' is imported explicitly prior to all
11+
* other imports from this library, or
12+
* 2. if the "development" condition is set.
813
*/
914
export function developmentInstanceOfCheck(
1015
value: unknown,

src/jsutils/instanceOf.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ export const symbolForGraphQLInstanceOfCheck = Symbol.for(
22
'graphql.instanceOfCheck',
33
);
44

5+
/**
6+
* "src/development.ts" includes an additional check for development mode
7+
* which throws on multiple versions of graphql-js.
8+
*
9+
* This additional check will be included:
10+
* 1. if 'graphql/development.js' is imported explicitly prior to all
11+
* other imports from this library, or
12+
* 2. if the "development" condition is set.
13+
*/
514
const check: (_value: unknown, _constructor: Constructor) => void =
615
(globalThis as any)[symbolForGraphQLInstanceOfCheck] ??
716
((_value: unknown, _constructor: Constructor) => {

0 commit comments

Comments
 (0)