Skip to content

Commit

Permalink
Fix code style issues with Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
madsci-bot authored and sgarner committed Sep 5, 2021
1 parent b022822 commit 0f31247
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export type MutationOperationFunction<TResult, TVariables extends OperationVaria
export interface MutationOperationParams<
TVariables extends OperationVariables,
TError = ApolloError,
TContext = ApolloOperationContext
TContext = ApolloOperationContext,
> {
mutation: DocumentNode;
variables: TVariables;
Expand Down Expand Up @@ -83,7 +83,7 @@ export async function mutateWithErrorHandling<
TResult,
TVariables extends OperationVariables,
TError,
TApp extends VueAppWithApollo = VueAppWithApollo
TApp extends VueAppWithApollo = VueAppWithApollo,
>(
app: TApp,
{ mutation, variables, onError, context }: MutationOperationParams<TVariables, TError>,
Expand Down Expand Up @@ -123,7 +123,7 @@ export function createMutationFunction<
TResult,
TVariables extends OperationVariables,
TError = ApolloError,
TApp extends VueAppWithApollo = VueAppWithApollo
TApp extends VueAppWithApollo = VueAppWithApollo,
>(
mutation: DocumentNode,
onError?: ApolloOperationErrorHandlerFunction<TError, TApp>,
Expand Down
10 changes: 5 additions & 5 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type VueApolloSmartQueryErrorHandler<
TResult = any,
TVariables = OperationVariables,
TError = ApolloError,
TComponent extends Vue = Vue
TComponent extends Vue = Vue,
> = (
error: TError,
vm: TComponent,
Expand All @@ -58,13 +58,13 @@ export type VueApolloSmartQueryOptions<
TResult = any,
TVariables = OperationVariables,
TError = ApolloError,
TComponent extends Vue = Vue
TComponent extends Vue = Vue,
> = VueApolloQueryDefinitionPatched<TComponent, TResult, TVariables> & {
error?: VueApolloSmartQueryErrorHandler<TResult, TVariables, TError, TComponent>;
};

export type VueApolloSmartQueryOptionsFunction<TResult, TVariables, TError = ApolloError, TApp extends Vue = Vue> = <
TComponent extends Vue = TApp
TComponent extends Vue = TApp,
>(
options?: Partial<Omit<VueApolloSmartQueryOptions<TResult, TVariables, TError, TComponent>, 'query'>>,
) => VueApolloSmartQueryOptions<TResult, TVariables, TError, TComponent>;
Expand Down Expand Up @@ -93,8 +93,8 @@ export function createSmartQueryOptionsFunction<TResult, TVariables, TError = Ap
...options,
error:
// we have to override vue-apollo types because they are incorrect
((options.error as unknown) as ErrorHandler | undefined) ?? onError !== undefined
? ((defaultErrorHandlerFn as unknown) as ErrorHandler)
(options.error as unknown as ErrorHandler | undefined) ?? onError !== undefined
? (defaultErrorHandlerFn as unknown as ErrorHandler)
: undefined,
};
};
Expand Down
10 changes: 5 additions & 5 deletions src/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export type VueApolloSmartSubscriptionErrorHandler<
TResult = any,
TVariables = OperationVariables,
TError = ApolloError,
TApp extends Vue = Vue
TApp extends Vue = Vue,
> = (
error: TError,
vm: TApp,
Expand All @@ -21,7 +21,7 @@ export type VueApolloSmartSubscriptionOptions<
TResult = any,
TVariables = OperationVariables,
TError = ApolloError,
TApp extends Vue = Vue
TApp extends Vue = Vue,
> = Omit<VueApolloSubscriptionDefinition<TVariables>, 'error'> & {
error?: VueApolloSmartSubscriptionErrorHandler<TResult, TVariables, TError, TApp>;
};
Expand All @@ -30,7 +30,7 @@ export function createSmartSubscriptionOptionsFunction<
TResult,
TVariables,
TError = ApolloError,
TApp extends Vue = Vue
TApp extends Vue = Vue,
>(
query: DocumentNode,
onError?: ApolloOperationErrorHandlerFunction<TError, TApp>,
Expand All @@ -57,8 +57,8 @@ export function createSmartSubscriptionOptionsFunction<
...options,
error:
// we have to override vue-apollo types because they are incorrect
((options.error as unknown) as ErrorHandler | undefined) ?? onError !== undefined
? ((defaultErrorHandlerFn as unknown) as ErrorHandler)
(options.error as unknown as ErrorHandler | undefined) ?? onError !== undefined
? (defaultErrorHandlerFn as unknown as ErrorHandler)
: undefined,
};
};
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ export interface ApolloErrorHandlerResult {
export type ApolloOperationErrorHandlerFunction<
TError = BaseApolloError,
TApp extends Vue = Vue,
TContext = ApolloOperationContext
TContext = ApolloOperationContext,
> = (error: TError, app: TApp, context?: TContext) => ApolloErrorHandlerResult;

0 comments on commit 0f31247

Please sign in to comment.