Skip to content

Remove an unnecessary includeDebugDetails #8857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dataconnect/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
file?: string;
warningLevel?: WarningLevel;
workarounds?: Workaround[];
[key: string]: any;

Check warning on line 93 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
};
}
export interface BuildResult {
Expand All @@ -106,7 +106,7 @@
};
}

export function requiresVector(dm?: DeploymentMetadata): boolean {

Check warning on line 109 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
return dm?.primaryDataSource?.postgres?.requiredExtensions?.includes("vector") ?? false;
}

Expand Down Expand Up @@ -195,7 +195,7 @@
connectorYaml: ConnectorYaml;
}

export function toDatasource(

Check warning on line 198 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
projectId: string,
locationId: string,
ds: DatasourceYaml,
Expand All @@ -220,12 +220,12 @@
query: string;
operationName?: string;
variables?: { [key: string]: string };
extensions?: { impersonate?: Impersonation; includeDebugDetails?: boolean };
extensions?: { impersonate?: Impersonation; };

Check failure on line 223 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Delete `;`

Check failure on line 223 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Delete `;`

Check failure on line 223 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Delete `;`

Check failure on line 223 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Delete `;`

Check failure on line 223 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Delete `;`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For improved readability and long-term maintainability, consider extracting the inline object type for extensions into its own named interface. This makes the ExecuteGraphqlRequest interface's definition cleaner and allows the extensions type to be reused or exported if needed in the future.

For example, you could define a new interface:

export interface GraphqlRequestExtensions {
  impersonate?: Impersonation;
}

And then use it in ExecuteGraphqlRequest as suggested.

Suggested change
extensions?: { impersonate?: Impersonation; };
extensions?: GraphqlRequestExtensions;

}

export interface GraphqlResponse {
data: Record<string, any>;

Check warning on line 227 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
errors: any[];

Check warning on line 228 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
}

export interface ExecuteOperationRequest {
Expand All @@ -234,11 +234,11 @@
}

export interface GraphqlResponseError {
error: { code: number; message: string; status: string; details: any[] };

Check warning on line 237 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
}

export const isGraphQLResponse = (g: any): g is GraphqlResponse => !!g.data || !!g.errors;

Check warning on line 240 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .errors on an `any` value

Check warning on line 240 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .data on an `any` value

Check warning on line 240 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
export const isGraphQLResponseError = (g: any): g is GraphqlResponseError => !!g.error;

Check warning on line 241 in src/dataconnect/types.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

interface ImpersonationAuthenticated {
authClaims: any;
Expand Down
Loading