We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b773059 commit d683281Copy full SHA for d683281
src/components/Voyager.tsx
@@ -87,14 +87,7 @@ export default class Voyager extends React.Component<VoyagerProps> {
87
return;
88
}
89
90
- let promise = this.props.introspection(getIntrospectionQuery());
91
-
92
- if (!isPromise(promise)) {
93
- throw new Error(
94
- 'SchemaProvider did not return a Promise for introspection.',
95
- );
96
- }
97
+ const promise = this.props.introspection(getIntrospectionQuery());
98
this.setState({
99
introspectionData: null,
100
schema: null,
@@ -249,8 +242,3 @@ export default class Voyager extends React.Component<VoyagerProps> {
249
242
return props.children || null;
250
243
};
251
244
252
253
-// Duck-type promise detection.
254
-function isPromise(value) {
255
- return typeof value === 'object' && typeof value.then === 'function';
256
-}
0 commit comments