Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
fix(NA): removed useless addGraphQLWS function.
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Apr 22, 2017
1 parent 0fedbd3 commit 24202de
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { SubscriptionClient, ClientOptions } from './client';
import { ExecutionResult } from 'graphql';
import { SubscriptionClient } from './client';

/**
* @deprecated This method will become deprecated in the new package graphql-transport-ws.
Expand All @@ -21,16 +20,3 @@ export function addGraphQLSubscriptions(networkInterface: any, wsClient: Subscri
},
});
}

export function addGraphQLWS(networkInterface: any, wsClientOptions: ClientOptions): any {
if (typeof networkInterface._uri !== 'string') {
throw new Error('Given networkInterface should have an uri defined to config the websocket.');
}

const wsClient = new SubscriptionClient(networkInterface._uri, wsClientOptions);
return Object.assign(addGraphQLSubscriptions(networkInterface, wsClient), {
query(request: any): Promise<ExecutionResult> {
return wsClient.query(request);
},
});
}

0 comments on commit 24202de

Please sign in to comment.