I’m trying to connect the Absinth socket link with the api of the Phoenix Socket.
import * as AbsintheSocket from "@absinthe/socket";
import { createAbsintheSocketLink } from "@absinthe/socket-apollo-link";
import { Socket as PhoenixSocket } from "phoenix";
export default createAbsintheSocketLink(AbsintheSocket.create(
new PhoenixSocket("ws://localhost:4000/socket")
));
And I’m getting an error:
Failed to compile.
./node_modules/@absinthe/socket/dist/index.js
Module not found: Can't resolve 'phoenix' in '/Users/romenigld/workspace/app-apollo-ui/node_modules/@absinthe/socket/dist'
and in my endpoint I have:
use Phoenix.Endpoint, otp_app: :plate_slate
use Absinthe.Phoenix.Endpoint
socket "/socket", PlateSlateWeb.UserSocket