graphql / graphql/graphiql

Feature Request: add an option to block query execution

Open
#2,744 1 comment 0 reactions 0 assignees View on GitHub
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

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.