Skip to content

[graphiql-react] Prettify button missing red error class on invalid queries #4160

@lesleydreyer

Description

@lesleydreyer

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The prettify button used to turn red if it failed to prettify, it doesn't seem to be doing that anymore

Expected Behavior

If you press the prettify button on an invalid query that cannot prettify, the button should turn red

Steps To Reproduce

In the swapi or netlify demos, type an incorrect query and press prettify

Image

The button used to turn red like this but doesn't anymore

Image

Environment

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

Anything else?

I think this could be fixed by throwing the errors in the prettifyEditors function, then in the ToolbarButton change the onClick type to onClick: (args?: any) => (any | Promise); and await the onClick

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