serializeRequest method Null safety

Map<String, dynamic> serializeRequest(
  1. Request request
)

Serializes the request

Extend this to add non-standard behavior

Implementation

Map<String, dynamic> serializeRequest(Request request) {
  final RequestExtensionsThunk? thunk = request.context.entry();

  return <String, dynamic>{
    "operationName": request.operation.operationName,
    "variables": request.variables,
    "query": printNode(request.operation.document),
    if (thunk != null) "extensions": thunk.getRequestExtensions(request),
  };
}