From 87ebd357da73ec83d72583f1c82fc14dfe2ffe5a Mon Sep 17 00:00:00 2001 From: enisdenjo Date: Fri, 13 Nov 2020 22:09:15 +0100 Subject: [PATCH] fix: Use `ID` type for message id field --- src/message.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/message.ts b/src/message.ts index fc91d4f7..07706fff 100644 --- a/src/message.ts +++ b/src/message.ts @@ -5,6 +5,7 @@ */ import { GraphQLError, ExecutionResult } from 'graphql'; +import { ID } from './types'; import { isObject, areGraphQLErrors, @@ -35,7 +36,7 @@ export interface ConnectionAckMessage { } export interface SubscribeMessage { - readonly id: string; + readonly id: ID; readonly type: MessageType.Subscribe; readonly payload: SubscribePayload; } @@ -47,19 +48,19 @@ export interface SubscribePayload { } export interface NextMessage { - readonly id: string; + readonly id: ID; readonly type: MessageType.Next; readonly payload: ExecutionResult; } export interface ErrorMessage { - readonly id: string; + readonly id: ID; readonly type: MessageType.Error; readonly payload: readonly GraphQLError[]; } export interface CompleteMessage { - readonly id: string; + readonly id: ID; readonly type: MessageType.Complete; }