request<TData, TVars> method
Stream<OperationResponse<TData, TVars> >
request<TData, TVars>(
- OperationRequest<
TData, TVars> operationRequest, [ - NextTypedLink<
TData, TVars> ? forward
override
Implementation
@override
Stream<OperationResponse<TData, TVars>> request<TData, TVars>(
OperationRequest<TData, TVars> operationRequest, [
forward,
]) =>
link.request(operationRequest.execRequest).transform(
StreamTransformer.fromHandlers(
handleData: (response, sink) => sink.add(
OperationResponse(
operationRequest: operationRequest,
data: (response.data == null || response.data!.isEmpty)
? null
: operationRequest.parseData(response.data!),
extensions:
response.context.entry<ResponseExtensions>()?.extensions,
graphqlErrors: response.errors,
dataSource: DataSource.Link,
),
),
handleError: (error, stackTrace, sink) => sink.add(
OperationResponse(
operationRequest: operationRequest,
linkException: error is LinkException
? error
: ServerException(
originalException: error,
parsedResponse: null,
),
dataSource: DataSource.Link,
),
),
),
);