UNPKG

2.76 kBPlain TextView Raw
1/**
2 * Copyright (c) 2021 GraphQL Contributors.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8/**
9 * GraphiQL
10 */
11
12import { GraphiQL } from './components/GraphiQL';
13export { GraphiQL };
14export default GraphiQL;
15
16/**
17 * Definitions
18 */
19export type { GraphiQLProps } from './components/GraphiQL';
20
21export type {
22 Fetcher,
23 FetcherOpts,
24 FetcherParams,
25 FetcherResult,
26 FetcherReturnType,
27 Observable,
28 Storage,
29 SyncFetcherResult,
30} from '@graphiql/toolkit';
31/**
32 * Components
33 */
34
35export { QueryEditor } from './components/QueryEditor';
36export { VariableEditor } from './components/VariableEditor';
37export { DocExplorer } from './components/DocExplorer';
38
39/**
40 * Toolbar
41 */
42export { ToolbarMenu, ToolbarMenuItem } from './components/ToolbarMenu';
43export { ToolbarButton } from './components/ToolbarButton';
44export { ToolbarGroup } from './components/ToolbarGroup';
45export { ToolbarSelect, ToolbarSelectOption } from './components/ToolbarSelect';
46
47/**
48 * Legacy exports
49 */
50import { onHasCompletion as _onHasCompletion } from '@graphiql/react';
51import {
52 fillLeafs as _fillLeafs,
53 getSelectedOperationName as _getSelectedOperationName,
54 mergeAst as _mergeAst,
55} from '@graphiql/toolkit';
56
57export const onHasCompletion: typeof _onHasCompletion =
58 function onHasCompletion(...args) {
59 console.warn(
60 'Importing `onHasCompletion` from `graphiql` is deprecated and will be removed in the next major version. Please switch to importing the `onHasCompletion` function provided by the `@graphiql/react` package.',
61 );
62 return _onHasCompletion(...args);
63 };
64
65export const fillLeafs: typeof _fillLeafs = function fillLeafs(...args) {
66 console.warn(
67 'Importing `fillLeafs` from `graphiql` is deprecated and will be removed in the next major version. Please switch to importing the `fillLeafs` function provided by the `@graphiql/toolkit` package.',
68 );
69 return _fillLeafs(...args);
70};
71
72export const getSelectedOperationName: typeof _getSelectedOperationName =
73 function getSelectedOperationName(...args) {
74 console.warn(
75 'Importing `getSelectedOperationName` from `graphiql` is deprecated and will be removed in the next major version. Please switch to importing the `getSelectedOperationName` function provided by the `@graphiql/toolkit` package.',
76 );
77 return _getSelectedOperationName(...args);
78 };
79
80export const mergeAst: typeof _mergeAst = function mergeAst(...args) {
81 console.warn(
82 'Importing `mergeAst` from `graphiql` is deprecated and will be removed in the next major version. Please switch to importing the `mergeAst` function provided by the `@graphiql/toolkit` package.',
83 );
84 return _mergeAst(...args);
85};