gql_sse_link 1.0.0-beta.3 copy "gql_sse_link: ^1.0.0-beta.3" to clipboard
gql_sse_link: ^1.0.0-beta.3 copied to clipboard

GQL terminating Link to execute GraphQL subscriptions over Server-Sent Events (graphql-sse "distinct connections" protocol).

example/gql_sse_link_example.dart

import "package:gql_link/gql_link.dart";
import "package:gql_sse_link/gql_sse_link.dart";

void main() {
  // ignore: unused_local_variable
  final link = Link.from([
    SseLink("https://example.com/graphql/stream"),
  ]);

  // In practice, compose with an HTTP link via `Link.split` so only
  // subscriptions hit the SSE endpoint:
  //
  // final link = Link.split(
  //   (request) =>
  //       request.operation.getOperationType() == OperationType.subscription,
  //   SseLink("https://example.com/graphql/stream"),
  //   HttpLink("https://example.com/graphql"),
  // );
}
0
likes
160
points
36
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

GQL terminating Link to execute GraphQL subscriptions over Server-Sent Events (graphql-sse "distinct connections" protocol).

Repository (GitHub)
View/report issues

Topics

#graphql #gql #gql-link #sse

License

MIT (license)

Dependencies

gql, gql_exec, gql_link, http, meta

More

Packages that depend on gql_sse_link