@@ -16,7 +16,6 @@ import {
16
16
17
17
import { getTypeGraph , SVGRender } from '../graph/' ;
18
18
import { extractTypeId , getSchema } from '../introspection' ;
19
- import { voyagerIntrospectionQuery } from '../utils/introspection-query' ;
20
19
import DocExplorer from './doc-explorer/DocExplorer' ;
21
20
import GraphViewport from './GraphViewport' ;
22
21
import { IntrospectionModal } from './IntrospectionModal' ;
@@ -25,8 +24,6 @@ import Settings from './settings/Settings';
25
24
import PoweredBy from './utils/PoweredBy' ;
26
25
import { VoyagerLogo } from './utils/VoyagerLogo' ;
27
26
28
- type IntrospectionProvider = ( query : string ) => Promise < any > ;
29
-
30
27
export interface VoyagerDisplayOptions {
31
28
rootType ?: string ;
32
29
skipRelay ?: boolean ;
@@ -46,7 +43,7 @@ const defaultDisplayOptions = {
46
43
} ;
47
44
48
45
export interface VoyagerProps {
49
- introspection : IntrospectionProvider | unknown ;
46
+ introspection : unknown ;
50
47
displayOptions ?: VoyagerDisplayOptions ;
51
48
introspectionPresets ?: { [ name : string ] : any } ;
52
49
allowToChangeSchema ?: boolean ;
@@ -66,19 +63,9 @@ export default function Voyager(props: VoyagerProps) {
66
63
} ) ;
67
64
68
65
useEffect ( ( ) => {
69
- let introspection = props . introspection ;
70
- if ( typeof introspection === 'function' ) {
71
- console . warn (
72
- 'GraphQLVoyager: Passing function as "introspection" is deprecated.' +
73
- 'To access introspection query, please use "voyagerIntrospectionQuery".' ,
74
- ) ;
75
-
76
- introspection = introspection ( voyagerIntrospectionQuery ) ;
77
- }
78
-
79
66
// FIXME: handle rejection and also handle errors inside introspection
80
67
// eslint-disable-next-line @typescript-eslint/no-floating-promises
81
- Promise . resolve ( introspection ) . then ( ( { data } ) => {
68
+ Promise . resolve ( props . introspection ) . then ( ( { data } ) => {
82
69
setIntrospectionData ( data ) ;
83
70
setSelected ( { typeID : null , edgeID : null } ) ;
84
71
} ) ;
0 commit comments