graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

[graphiql] - Upgrading to 3.1.0 causes runtime error

Open oferitz opened this issue 1 year ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

https://github.com/graphql/graphiql/issues/2763 - Already mention this issue, maybe a regression?

Current Behavior

After upgrading graphiql from 3.0.5 to 3.1.0 i'm getting the following runtime error in the browser console

Screenshot 2024-01-21 at 14 01 54

Expected Behavior

Upgrading error should not throw error

Steps To Reproduce

No response

Environment

  • GraphiQL Version: 3.1.0
  • OS: macOS 14.1.2
  • Browser: Chrome 120
  • Bundler: Vite
  • react Version: 18.2.0
  • graphql Version: 16.8.1

Anything else?

No response

oferitz avatar Jan 21 '24 12:01 oferitz

Happens for us as well when using toolbar with additionalContent with a plugin which uses useEditorContext.

E.g. with using the plugin from this pull request: https://github.com/graphql/graphiql/pull/3055

I think if that is expected to happen then I feel like some documentation for the toolbar and adding a how-to do a toolbar plugin is missing.

mutefiRe avatar Feb 06 '24 15:02 mutefiRe

If you add a no-op for the caller you can get a new error:

useEditorContext({
    nonNull: true,
    caller: () => {},
  });
Screenshot 2024-07-25 at 3 27 33 PM

vibdev avatar Jul 25 '24 22:07 vibdev