Feature Request: add an option to block query execution
Open
enhancement
graphiql
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.9k
- Avg merge
- 22h 45m
- Merged PRs (30d)
- 70
Description
Coming from https://github.com/graphql/graphiql/issues/2721
I am running some validations and would like to block requests on a client side.
Atm, I replace fetcher with custom error message, which does not seem ideal.
```js
const query = queryEditor?.getValue()
useEffect(() => {
const isValid = validateQuery(query)
setExecutable(isValid)
}, [query, setExecutable])
Promise.reject('Query is not executable')
}
/>
```
Maybe extend `useExecutionContext` hook?
---
GraphiQL 2.0 is amazing! Thank you for the great work! 🙌
Contributor guide
Assessment
This issue has not been assessed yet.