Skip to content

[graphiql] Setting defaultHeaders causes TypeError: doc.iter is not a function #3870

Closed
@netcoding87

Description

@netcoding87

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Creating an example based on Unpkg (CDN), I want to add defaultHeaders additionally doing it so:

...
root.render(
      React.createElement(GraphiQL, {
        fetcher,
        defaultEditorToolsVisibility: true,
        defaultHeaders: { 'foo': 'bar' },
        plugins: [explorerPlugin],
      }),
    );

When loading the page I get this on the console:

Image

Expected Behavior

Page loads with default Headers set.

Steps To Reproduce

Open https://codesandbox.io/p/sandbox/7my5dd
See console output

Environment

  • GraphiQL Version:
  • OS:
  • Browser:
  • Bundler:
  • react Version:
  • graphql Version:

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions