Skip to content

Commit

Permalink
Remove special persistedFetchError event
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Apr 22, 2020
1 parent f9c4996 commit 6a6cb37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
11 changes: 4 additions & 7 deletions exchanges/persisted-fetch/src/persistedFetchExchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,18 @@ const makePersistedFetchSource = (
const error = !result.data ? result.error : undefined;

dispatchDebug({
type: persistFail
? 'persistedFetchError'
: error
? 'fetchError'
: 'fetchSuccess',
// TODO: Assign a new name to this once @urql/devtools supports it
type: persistFail || error ? 'fetchError' : 'fetchSuccess',
message: persistFail
? 'A Persisted Query request has failed. A normal GraphQL request will follow.'
? 'A Persisted Query request has failed. A non-persisted GraphQL request will follow.'
: `A ${
error ? 'failed' : 'successful'
} fetch response has been returned.`,
operation,
data: {
url,
fetchOptions,
value: error || result,
value: persistFail ? result.error : (error || result),
},
});
})
Expand Down
5 changes: 0 additions & 5 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ export interface DebugEventTypes {
retryRetrying: {
retryCount: number;
};
// persistedFetchExchange
persistedFetchError: {
url: string;
fetchOptions: RequestInit;
};
}

export type DebugEventArg<T extends keyof DebugEventTypes | string> = {
Expand Down

0 comments on commit 6a6cb37

Please sign in to comment.