Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
request(operation: Operation, _next: NextLink): Observable {
return new Observable((observer) => {
var channelId = Math.round(Date.now() + Math.random() * 100000).toString(16)
var actionName = this.actionName
var connectionParams = (typeof this.connectionParams === "function") ?
this.connectionParams(operation) : this.connectionParams
var channel = this.cable.subscriptions.create(Object.assign({},{
channel: this.channelName,
channelId: channelId
}, connectionParams), {
connected: function() {
channel.perform(
actionName,
{
query: operation.query ? print(operation.query) : null,
variables: operation.variables,
// This is added for persisted operation support:
operationId: (operation as {operationId?: string}).operationId,