Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

did API change? #2

Open
acomito opened this issue Jun 16, 2017 · 0 comments
Open

did API change? #2

acomito opened this issue Jun 16, 2017 · 0 comments

Comments

@acomito
Copy link

acomito commented Jun 16, 2017

I was getting errors at first ("must pass in a port or server"), SubscriptionServer needs an object as the second arg:

const createApolloSubscriptionServer = ({ subscriptionManager }) => {
    const httpServer = createServer((request, response) => {
        response.writeHead(404);
        response.end();
    });
    console.log(WS_PORT)
    httpServer.listen(WS_PORT, () => console.log(
        `Websocket Server is now running on port ${WS_PORT}`
    ));

    return new SubscriptionServer({ subscriptionManager }, { server: httpServer }); // change here
}

found it by comparing your repo to this tutorial:

https://medium.com/@simontucker/building-chatty-part-6-graphql-subscriptions-b54df7d63e27

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

No branches or pull requests

1 participant