coalesceErrors function
OperationException?
coalesceErrors({
- List<
GraphQLError> ? graphqlErrors, - LinkException? linkException,
- List? raw,
- OperationException? exception,
(graphqlErrors?, exception?) => exception?
merges both optional graphqlErrors and an optional container into a single optional container NOTE: NULL returns expected
Implementation
OperationException? coalesceErrors({
List<GraphQLError>? graphqlErrors,
LinkException? linkException,
List<dynamic>? raw,
OperationException? exception,
}) {
if (exception != null ||
linkException != null ||
(graphqlErrors != null && graphqlErrors.isNotEmpty)) {
return OperationException(
linkException: linkException ?? exception?.linkException,
raw: raw,
graphqlErrors: [
if (graphqlErrors != null) ...graphqlErrors,
if (exception?.graphqlErrors != null) ...exception!.graphqlErrors
],
);
}
return null;
}