github-actions
released this
18 Aug 19:20
·
930 commits
to main
since this release
Minor Changes
-
66b9261: Allow lazy registration of the GraphQL layer on a socket basis. This is useful for use-cases where authentication must be done BEFORE any GraphQL operations could be executed.
const socketIOGraphQLServer = registerSocketIOGraphQLServer({ socketServer, isLazy: true }); socketServer.on("connection", socket => { socket.on("auth", message => { validateAuth(message); // allow consuming the GraphQL API if authentication passes. const dispose = socketIOGraphQLServer.registerSocket(socket); // disable consuming the GraphQL API for the given socket. dispose(); // you could also do the following for disposing instead: socketIOGraphQLServer.disposeSocket(socket); }); });