This is not a bug, per-say - however an implicit dependency's ( @graphiql/plugin-explorer ) newer versions ( 0.3.0+ ) introduced a new implementation pattern, which if we take the latest version of that dependency, will result in a build failure.
For context, while working on #9081 (which makes implicit dependencies more explicit), I noticed there is a breaking change for @graphiql/plugin-explorer from https://github.com/graphql/graphiql/pull/3330 (details below)
There is some work on our end to change over the implementation pattern, and not sure if it is worth it, so to be clear I am not advocating one way or the other. Just wanted to call it out in case we did want to move to the later versions of @graphiql/plugin-explorer.
import { explorerPlugin } from '@graphiql/plugin-explorer';
import { snippets } from './snippets';
import { codeExporterPlugin } from '@graphiql/plugin-code-exporter';
import { createGraphiQLFetcher } from '@graphiql/toolkit';
// only invoke these inside the component lifecycle
// if there are dynamic values, and then use useMemo() (see below)
const explorer = explorerPlugin();
const exporter = codeExporterPlugin({ snippets });
const fetcher = createGraphiQLFetcher({ url: '/graphql' });
const App = () => {
return <GraphiQL plugins={[explorer, exporter]} fetcher={fetcher} />;
};
What's not working?
This is not a bug, per-say - however an implicit dependency's (
@graphiql/plugin-explorer
) newer versions (0.3.0
+ ) introduced a new implementation pattern, which if we take the latest version of that dependency, will result in a build failure.For context, while working on #9081 (which makes implicit dependencies more explicit), I noticed there is a breaking change for
@graphiql/plugin-explorer
from https://github.com/graphql/graphiql/pull/3330 (details below)There is some work on our end to change over the implementation pattern, and not sure if it is worth it, so to be clear I am not advocating one way or the other. Just wanted to call it out in case we did want to move to the later versions of
@graphiql/plugin-explorer
.( cc @Josh-Walker-GM, @dthyresson )
Redwood's usage
https://github.com/redwoodjs/redwood/blob/e689299084ae3cf375d1fd05d800491823f8cd5b/packages/studio/web/src/Components/RedwoodGraphiQL/RedwoodGraphiQL.tsx#L4
https://github.com/redwoodjs/redwood/blob/e689299084ae3cf375d1fd05d800491823f8cd5b/packages/studio/web/src/Components/RedwoodGraphiQL/RedwoodGraphiQL.tsx#L140-L144
@graphiql/plugin-explorer
's new implementation patternFrom the release notes:
How do we reproduce the bug?
# use latest of @graphiql/plugin-explorer
What's your environment? (If it applies)
No response
Are you interested in working on this?