gql_sse_link 1.0.0-beta.3
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"),
// );
}