Skip to content

Commit 12ce1bd

Browse files
committed
Addressed comments
1 parent 23b7845 commit 12ce1bd

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/data-connect/src/api/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ export {
2626
DataConnectErrorCode,
2727
DataConnectError,
2828
DataConnectOperationError,
29-
DataConnectOperationResponse,
30-
DataConnectOperationErrorInfo
29+
DataConnectOperationFailureResponse,
30+
DataConnectOperationFailureResponseErrorInfo
3131
} from '../core/error';

packages/data-connect/src/core/error.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ export class DataConnectOperationError extends DataConnectError {
6565
readonly name: string = 'DataConnectOperationError';
6666

6767
/** The response received from the backend. */
68-
readonly response: DataConnectOperationResponse;
68+
readonly response: DataConnectOperationFailureResponse;
6969

7070
/** @hideconstructor */
71-
constructor(message: string, response: DataConnectOperationResponse) {
71+
constructor(message: string, response: DataConnectOperationFailureResponse) {
7272
super(Code.PARTIAL_ERROR, message);
7373
this.response = response;
7474
}
7575
}
7676

77-
export interface DataConnectOperationResponse {
77+
export interface DataConnectOperationFailureResponse {
7878
// The "data" provided by the backend in the response message.
7979
//
8080
// Will be `undefined` if no "data" was provided in the response message.
@@ -84,12 +84,12 @@ export interface DataConnectOperationResponse {
8484
readonly data?: Record<string, unknown> | null;
8585

8686
// The list of errors provided by the backend in the response message.
87-
readonly errors: DataConnectOperationErrorInfo[];
87+
readonly errors: DataConnectOperationFailureResponseErrorInfo[];
8888
}
8989

9090
// Information about the error, as provided in the response from the backend.
9191
// See https://spec.graphql.org/draft/#sec-Errors
92-
export interface DataConnectOperationErrorInfo {
92+
export interface DataConnectOperationFailureResponseErrorInfo {
9393
// The error message.
9494
readonly message: string;
9595

packages/data-connect/src/network/fetch.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
Code,
2020
DataConnectError,
2121
DataConnectOperationError,
22-
DataConnectOperationResponse
22+
DataConnectOperationFailureResponse
2323
} from '../core/error';
2424
import { SDK_VERSION } from '../core/version';
2525
import { logDebug, logError } from '../logger';
@@ -113,7 +113,7 @@ export function dcFetch<T, U>(
113113
.then(res => {
114114
if (res.errors && res.errors.length) {
115115
const stringified = JSON.stringify(res.errors);
116-
const response: DataConnectOperationResponse = {
116+
const response: DataConnectOperationFailureResponse = {
117117
errors: res.errors,
118118
data: res.data
119119
};

0 commit comments

Comments
 (0)