Skip to content

[graphiql] defaultQuery with empty string does not result in empty default query #3495

Closed
@incompl

Description

@incompl

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Currently if you set defaultQuery="" you get the commented intro text in the editor by default.

Expected Behavior

I expect the query editor to be empty in this case.

Steps To Reproduce

  • Add defaultQuery="" to your GraphiQL component
  • Clear localstorage so you don't get your last query shown by default and refresh

Environment

  • GraphiQL Version: 3.1.0
  • OS: OSX 13.6.1
  • Browser: Chrome 120.0.6099.199
  • Bundler: Webpack
  • react Version: 18.2.0
  • graphql Version: 16.6.0

Anything else?

This worked as expected previously. I am upgrading from 1.x to 3.x.

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