Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
API reference
lib
Client

lib/client

DgraphClientError

Extends

  • Error

Constructors

new DgraphClientError(errors, query, variables)

new DgraphClientError(
   errors, 
   query, 
   variables): DgraphClientError
Parameters
ParameterType
errorsany[]
querystring
variablesany
Returns

DgraphClientError

Overrides

Error.constructor

Properties

message

message: string;
Inherited from

Error.message

name

name: string = "DgraphClientError";
Overrides

Error.name

stack?

optional stack: string;
Inherited from

Error.stack

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any;

Optional override for formatting stack traces

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters
ParameterType
errError
stackTracesCallSite[]
Returns

any

Inherited from

Error.prepareStackTrace

stackTraceLimit

static stackTraceLimit: number;
Inherited from

Error.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters
ParameterType
targetObjectobject
constructorOpt?Function
Returns

void

Inherited from

Error.captureStackTrace


DgraphClientParams

Properties

authHeader?

optional authHeader: string;
Default
"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 header value

Dgraph Cloud Authentication

endpoint

endpoint: string;

jwtAlgorithm?

optional jwtAlgorithm: "HS256" | "RS256";
Default
"RS256"
 
[Using JWT and authorization claims](https://dgraph.io/docs/graphql/authorization/authorization-overview#using-jwts-and-authorization-claims)

jwtSecret?

optional jwtSecret: string;

Using JWT and authorization claims


client()

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

Parameters

ParameterType
paramsDgraphClientParams

Returns

{
  run: Promise<null | T>;
}

run()

Type parameters
Type parameter
T
Parameters
ParameterType
querystring
variables?Record<string, any>
Returns

Promise<null | T>

Auth.js © Balázs Orbán and Team - 2024