subscription method

Future<Snapshot> subscription(
  1. String document,
  2. {String? key,
  3. Map<String, dynamic>? variables,
  4. Map<String, String>? headers}
)

Execute a Subscription from a Document

Implementation

Future<Snapshot> subscription(
  String document, {
  String? key,
  Map<String, dynamic>? variables,
  Map<String, String>? headers,
}) async {
  final _document = document.trim();
  final _key = key ?? _keyGenerator.generateBase(document);

  return executeSubscription(
    Query(
      key: _key,
      headers: headers,
      document: _document,
      variables: variables,
    ),
  );
}