-
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 to trigger development instanceOf()
Changes this library to use the development version of instanceOf when a condition is set rather than based on a Node JS specific environment variable.
- Loading branch information
Showing
17 changed files
with
304 additions
and
124 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.