Skip to content

infleet/absinthe-socket-link-dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

absinthe_socket_link

Dart library to interact with Absinthe Subscriptions over Phoenix Channels.

This library uses phoenix_socket for Phoenix Channel, making the API consistent across web and native environments.

Usage

This is a simple implementation.

Link createGraphqlLink() async {
  final HttpLink httpLink = HttpLink("http://localhost/graphql");

  final phoenixSocket = PhoenixSocket(
    "ws://localhost/graphql/websocket",
    socketOptions: PhoenixSocketOptions(
      params: {"authorization": 'My Strong Token'},
    ),
  );

  final wsLink = AbsintheSocketLink(phoenixSocket);

  return Link.split(
    (request) => request.isSubscription,
    wsLink, httpLink,
  );
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages