跳到內容
從 NextAuth.js v4 遷移?請閱讀 我們的遷移指南.

lib/client

DgraphClientError

繼承自

建構函式

new DgraphClientError(errors, query, variables)

new DgraphClientError(
   errors, 
   query, 
   variables): DgraphClientError
參數
參數類型
errorsany[]
querystring
variablesany
返回

DgraphClientError

覆寫

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錯誤
stackTracesCallSite[]
返回

any

繼承自

Error.prepareStackTrace

stackTraceLimit

static stackTraceLimit: number;
繼承自

Error.stackTraceLimit

方法

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

在目標物件上建立 .stack 屬性

參數
參數類型
targetObjectobject
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 標頭值

Dgraph Cloud 驗證

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;

使用 JWT 和授權宣告


client()

client(params): {
  run: Promise<null | T>;
}

參數

參數類型
paramsDgraphClientParams

返回

{
  run: Promise<null | T>;
}

run()

類型參數
類型參數
T
參數
參數類型
querystring
variables?Record<string, any>
返回

Promise<null | T>

Auth.js © Balázs Orbán 和團隊 -2024