diff --git a/.changeset/shaggy-eyes-melt.md b/.changeset/shaggy-eyes-melt.md new file mode 100644 index 00000000000..9233e74a67c --- /dev/null +++ b/.changeset/shaggy-eyes-melt.md @@ -0,0 +1,5 @@ +--- +"@graphiql/plugin-explorer": patch +--- + +Use named `Explorer` import from `graphiql-explorer` to fix an issue where the bundler didn't correctly choose either the `default` or `Explorer` import. This change should ensure that `@graphiql/plugin-explorer` works correctly without `graphiql-explorer` being bundled. diff --git a/packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts b/packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts index d9560f7521f..66fffce659a 100644 --- a/packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts +++ b/packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts @@ -61,5 +61,7 @@ declare module 'graphiql-explorer' { defaultValue: (arg: GraphQLLeafType) => ValueNode; }; + export { GraphiQLExplorer as Explorer }; + export default GraphiQLExplorer; } diff --git a/packages/graphiql-plugin-explorer/src/index.tsx b/packages/graphiql-plugin-explorer/src/index.tsx index 35be73d05e8..228f05f052a 100644 --- a/packages/graphiql-plugin-explorer/src/index.tsx +++ b/packages/graphiql-plugin-explorer/src/index.tsx @@ -4,7 +4,10 @@ import { useExecutionContext, useSchemaContext, } from '@graphiql/react'; -import GraphiQLExplorer, { GraphiQLExplorerProps } from 'graphiql-explorer'; +import { + Explorer as GraphiQLExplorer, + GraphiQLExplorerProps, +} from 'graphiql-explorer'; import React, { useCallback, useRef } from 'react'; import './graphiql-explorer.d.ts'; @@ -71,6 +74,7 @@ const checkboxUnchecked = ( ); + const checkboxChecked = (