lib/client
DgraphClientError
繼承自
建構函式
new DgraphClientError(errors, query, variables)
new DgraphClientError(
errors,
query,
variables): DgraphClientError
參數
參數 | 類型 |
---|---|
errors | any [] |
query | string |
variables | any |
返回
覆寫
Error.constructor
屬性
message
message: string;
繼承自
Error.message
name
name: string = "DgraphClientError";
覆寫
Error.name
stack?
optional stack: string;
繼承自
Error.stack
prepareStackTrace()?
static optional prepareStackTrace: (err, stackTraces) => any;
格式化堆疊追蹤的可選覆寫
參見
https://v8.dev.org.tw/docs/stack-trace-api#customizing-stack-traces
參數
參數 | 類型 |
---|---|
err | 錯誤 |
stackTraces | CallSite [] |
返回
any
繼承自
Error.prepareStackTrace
stackTraceLimit
static stackTraceLimit: number;
繼承自
Error.stackTraceLimit
方法
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void
在目標物件上建立 .stack 屬性
參數
參數 | 類型 |
---|---|
targetObject | object |
constructorOpt ? | Function |
返回
void
繼承自
Error.captureStackTrace
DgraphClientParams
屬性
authHeader?
optional authHeader: string;
預設
"Authorization"
[Using JWT and authorization claims](https://dgraph.io/docs/graphql/authorization/authorization-overview#using-jwts-and-authorization-claims)
authToken
authToken: string;
X-Auth-Token
標頭值
endpoint
endpoint: string;
jwtAlgorithm?
optional jwtAlgorithm: "HS256" | "RS256";
預設
"RS256"
[Using JWT and authorization claims](https://dgraph.io/docs/graphql/authorization/authorization-overview#using-jwts-and-authorization-claims)
jwtSecret?
optional jwtSecret: string;
client()
client(params): {
run: Promise<null | T>;
}
參數
參數 | 類型 |
---|---|
params | DgraphClientParams |
返回
{
run: Promise<null | T>;
}
run()
類型參數
類型參數 |
---|
T |
參數
參數 | 類型 |
---|---|
query | string |
variables ? | Record <string , any > |
返回
Promise
<null
| T
>