graphql / graphql/graphiql

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

Open
#4,160 0 comments 0 reactions 0 assignees View on GitHub
bug graphiql
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

### Is there an existing issue for this?

- [x] 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.