Skip to content

Fixed using GraphiQLPluginExplorer #1237

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iafilin
Copy link

@iafilin iafilin commented Mar 1, 2025

No description provided.

@kevinvalk
Copy link

kevinvalk commented Apr 25, 2025

Note to self: always important to check open PRs! Anyways, you removed a bit too much here. You can still pass on the query and onEdit parameters.

        {% if enable_explorer_plugin %}
        var explorerPlugin = GraphiQLPluginExplorer.explorerPlugin({
          query: query,
          onEdit: setQuery,
        });
        {% endif %}

That said, it seems that query and setQuery is not needed anymore so the whole AriadneGraphiQL function can be simplified to

      function AriadneGraphiQL() {
        {% if enable_explorer_plugin %}
        var explorerPlugin = GraphiQLPluginExplorer.explorerPlugin();
        {% endif %}
        return React.createElement(GraphiQL, {
          fetcher: fetcher,
          defaultEditorToolsVisibility: true,
          {% if enable_explorer_plugin %}
          plugins: [explorerPlugin],
          {% endif %}
        });
      }

@iafilin would you mind adjusting this PR?

P.S. You also need to fix the test snapshots, do you need any help with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants