Skip to content

Commit

Permalink
fix(core): fixes Service.kind -redeclaring an inherited property set …
Browse files Browse the repository at this point in the history
…on super causes it to be undefi
  • Loading branch information
rafamel committed Nov 24, 2019
1 parent 16d7690 commit c2536da
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/core/src/classes/Service/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Service<
I = any,
O = any,
C = any
> extends Element<ServiceUnion> {
> extends Element<ServiceUnion & Record<'kind', K>> {
public static ensure<
T = false,
K extends ServiceKind = ServiceKind,
Expand All @@ -40,19 +40,18 @@ export class Service<
public static query<I = any, O = any, C = any>(
query: ServiceQueryInput<true, I, O, C>
): Service<true, 'query', I, O, C> {
return new Service({ kind: 'query', ...query });
return new Service({ ...query, kind: 'query' });
}
public static mutation<I = any, O = any, C = any>(
mutation: ServiceMutationInput<true, I, O, C>
): Service<true, 'mutation', I, O, C> {
return new Service({ kind: 'mutation', ...mutation });
return new Service({ ...mutation, kind: 'mutation' });
}
public static subscription<I = any, O = any, C = any>(
subscription: ServiceSubscriptionInput<true, I, O, C>
): Service<true, 'subscription', I, O, C> {
return new Service({ kind: 'subscription', ...subscription });
return new Service({ ...subscription, kind: 'subscription' });
}
public readonly kind: K;
public readonly request: string | AbstractSchema;
public readonly response: string | AbstractSchema;
public readonly exceptions: ServiceExceptionsUnion;
Expand Down

0 comments on commit c2536da

Please sign in to comment.