diff --git a/src/components/Voyager.tsx b/src/components/Voyager.tsx index 33b19c8f..3e08bd77 100644 --- a/src/components/Voyager.tsx +++ b/src/components/Voyager.tsx @@ -87,14 +87,7 @@ export default class Voyager extends React.Component { return; } - let promise = this.props.introspection(getIntrospectionQuery()); - - if (!isPromise(promise)) { - throw new Error( - 'SchemaProvider did not return a Promise for introspection.', - ); - } - + const promise = this.props.introspection(getIntrospectionQuery()); this.setState({ introspectionData: null, schema: null, @@ -249,8 +242,3 @@ export default class Voyager extends React.Component { return props.children || null; }; } - -// Duck-type promise detection. -function isPromise(value) { - return typeof value === 'object' && typeof value.then === 'function'; -}