onOperation abstract method

FutureOr<GraphQLResult> onOperation(
  1. String id,
  2. String query, [
  3. Map<String, dynamic>? variables,
  4. String? operationName,
])

Executes one operation and answers its result.

id identifies the operation within the connection, so that a subscription's events can be routed back to it. Throwing from here answers the client an error message naming id, which is what a document the schema refuses comes back as; errors carried by the result instead travel alongside the data in a next.

Implementation

FutureOr<GraphQLResult> onOperation(
  String id,
  String query, [
  Map<String, dynamic>? variables,
  String? operationName,
]);