Skip to content

createSubscriber throwing an Error #60

@jakiw

Description

@jakiw

My code:

import { Socket as PhoenixSocket } from "phoenix";
import * as AbsintheSocket from "@absinthe/socket";
import {createSubscriber} from "@absinthe/socket-relay";
const phoenixSocket = new PhoenixSocket(webSocketUrl, {
  params: () => {
  }
});
const absintheSocket = AbsintheSocket.create(phoenixSocket)
const subscribe = createSubscriber(absintheSocket)

running with relay version 12. I get

TypeError: _ref3 is undefined

on line 49 of src/createSubscriber.js. The compiled code that throws looks like:

  142 | 
  143 | return function (_ref2, variables, cacheConfig, _ref3) {
  144 |   var operation = _ref2.text;
> 145 |   var OnUnrecoverableError = _ref3.onError,
      |                              ^  146 |       onNext = _ref3.onNext;
  147 | 
  148 |   _babel_runtime_helpers_newArrowCheck__WEBPACK_IMPORTED_MODULE_9___default()(this, _this5); // we need to place this logic here and not in ensureIsSubscription as if we

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions