-
-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Description
The Problem
The return type for the server is different from the relay error type so i created the interface and a helper to handle errors and i got the error bellow i think a good solution would be to add the generic type to the useMutation hook
Behaviour
How i thought to resolve this issue
export interface MutationConfig<TOperation extends MutationParameters, TError = Error> {
configs?: DeclarativeMutationConfig[];
cacheConfig?: CacheConfig;
mutation: GraphQLTaggedNode;
onError?: ((error: Error) => void) | null;
onCompleted?:
| ((response: TOperation['response'], errors: ReadonlyArray<PayloadError> | null | undefined) => void)
| null;
onUnsubscribe?: () => void | null | undefined;
optimisticResponse?: TOperation['response'];
optimisticUpdater?: SelectorStoreUpdater<TOperation['response']> | null;
updater?: SelectorStoreUpdater<TOperation['response']> | null;
uploadables?: UploadableMap | null;
variables: TOperation['variables'];
}