Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(graphiql-plugin-explorer): Use named Explorer import from graphiql-explorer #3319

Merged
merged 5 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shaggy-eyes-melt.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions packages/graphiql-plugin-explorer/src/graphiql-explorer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ declare module 'graphiql-explorer' {
defaultValue: (arg: GraphQLLeafType) => ValueNode;
};

export { GraphiQLExplorer as Explorer };

export default GraphiQLExplorer;
}
6 changes: 5 additions & 1 deletion packages/graphiql-plugin-explorer/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -71,6 +74,7 @@ const checkboxUnchecked = (
<circle cx="7.5" cy="7.5" r="6" stroke="currentColor" fill="none" />
</svg>
);

const checkboxChecked = (
<svg
viewBox="0 0 15 15"
Expand Down