graphql / graphiql

GraphiQL & the GraphQL LSP Reference Ecosystem for building browser & IDE tools.
MIT License
15.94k stars 1.71k forks source link

[graphiql] - Upgrading to 3.1.0 causes runtime error #3509

Open oferitz opened 7 months ago

oferitz commented 7 months ago

Is there an existing issue for this?

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

Anything else?

No response

mutefiRe commented 7 months ago

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.

vibdev commented 1 month ago

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