Skip to content

[graphiql] Tab duplicating when using only shouldPersistHeaders.  #3107

@tcK1

Description

@tcK1

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When refreshing (F5 or cmd/ctrl+r) the page, sometimes the current tab is duplicated without the persisted headers.

Expected Behavior

It should not duplicate the tab.

Steps To Reproduce

Comment all these props besides `shouldPersistHeaders: true,`.

https://github.com/graphql/graphiql/blob/9d9478aea7536d2957e4371cef4f30577db2113d/packages/graphiql/resources/renderExample.js#L99-L110

This is also easily reproduced in the wild using the CDN example and setting the `shouldPersistHeaders: true` prop.

Module pattern

  • graphiql-umd
  • graphiql-esm
  • graphiql-commonjs

Environment

- GraphiQL Version: master
- OS: MacOS
- Browser: chrome

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