Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When used with apollo-link-ws it throws error for apolloLogger #35

Open
schavaLogi opened this issue Aug 30, 2018 · 2 comments
Open

When used with apollo-link-ws it throws error for apolloLogger #35

schavaLogi opened this issue Aug 30, 2018 · 2 comments

Comments

@schavaLogi
Copy link

  • apollo-link-logger version: ^1.2.3
  • node version: v8.9.3
  • npm (or yarn) version: yarn 1.6.0

Relevant code or config

      const webSocketLink = from(webSocketChain);
      this.linkWS = split() // to decide HTTP or WS

What you did: Added apollo-logger before wsLink in chain

What happened:
TypeError: forward(...).map is not a function

@veeramarni
Copy link

veeramarni commented Nov 16, 2018

This issue still exists. It happens when you have mutations and queries running in WS

@SillyFreak
Copy link

same here; took me a while to find the culprit. In detail, I have a setup like this:

const link = from([
  stateLink,  // withClientState(...)
  errorLink,  // onError(...)
  ...(__DEV__ ? [apolloLogger] : []),  // <-- removing this fixes the error
  split(
    ({ query }) => {
      const { kind, operation } = getMainDefinition(query);
      return kind === 'OperationDefinition' && operation === 'subscription';
    },
    wsLink,  // new new WebSocketLink(...)
    httpLink,  // new new HttpLink(...)
  ),
]);

and I use subscribeToMore somewhere. Result is TypeError: forward(...).map is not a function and the subscription not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants