graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

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

Open incompl opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] 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.

incompl avatar Jan 11 '24 20:01 incompl