Suggestion: Export withPromise for easier typing in typescript tests
Author: probablykabariCreated Apr 5, 2023Updated Apr 7, 2023
Labelsfuture 🔮
If you're coming from v3 -> v4 in typescript the following results in a type error because this is a Source<OperationResult> instead of OperationResultSource<OperationResult>:
// on a mock Urql client
executeQuery: () => {
const result = makeResult(....) // OperationResult
return fromValue(result) // Source<OperationResult>
};It's a small thing but I think it is better to have access to the util than use as OperationResultSource<OperationResult> for anyone consuming the library.
Source: urql-graphql/urql