-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use conditional imports instead of environment for instanceOf checks
- Loading branch information
Showing
17 changed files
with
302 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const assert = require('assert'); | ||
|
||
const { isSchema } = require('graphql'); | ||
|
||
class GraphQLSchema { | ||
get [Symbol.toStringTag]() { | ||
return 'GraphQLSchema'; | ||
} | ||
} | ||
const notSchema = new GraphQLSchema(); | ||
let error; | ||
try { | ||
isSchema(notSchema); | ||
} catch (_error) { | ||
error = _error; | ||
} | ||
assert( | ||
String(error?.message).match( | ||
/^Cannot use GraphQLSchema "{}" from another module or realm./m, | ||
), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable simple-import-sort/imports */ | ||
import assert from 'assert'; | ||
|
||
import { isSchema } from 'graphql-esm'; | ||
|
||
class GraphQLSchema { | ||
get [Symbol.toStringTag]() { | ||
return 'GraphQLSchema'; | ||
} | ||
} | ||
const notSchema = new GraphQLSchema(); | ||
let error; | ||
try { | ||
isSchema(notSchema); | ||
} catch (_error) { | ||
error = _error; | ||
} | ||
assert( | ||
String(error?.message).match( | ||
/^Cannot use GraphQLSchema "{}" from another module or realm./m, | ||
), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.