Skip to content
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

New type for representing the Supergraph connection details #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions ndc-lambda-sdk/src/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ export function getErrorDetails(error: Error): ErrorDetails {
}
}

// NOTE: This should be provided by the NDC SDK types at some point
// then this can be replaced and won't have to be kept in sync
// manually with the engine changes.
export type Supergraph = {
endpoint: string
}

function buildCausalStackTrace(error: Error): string {
let seenErrs: Error[] = [];
let currErr: Error | undefined = error;
Expand Down
4 changes: 4 additions & 0 deletions ndc-lambda-sdk/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ export class JSONValue {
return this.#value;
}

get toJSON(): unknown {
return this.#value;
}

/**
* @internal
*/
Expand Down
2 changes: 1 addition & 1 deletion ndc-lambda-sdk/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { JSONValue } from "./schema";
export { ConnectorError, BadRequest, Forbidden, Conflict, UnprocessableContent, InternalServerError, NotSupported, BadGateway } from "@hasura/ndc-sdk-typescript";
export { withActiveSpan, USER_VISIBLE_SPAN_ATTRIBUTE } from "@hasura/ndc-sdk-typescript/instrumentation"
export { ErrorDetails, getErrorDetails } from "./execution";
export { ErrorDetails, getErrorDetails, Supergraph } from "./execution";