lib/client
DgraphClientError
Extends
Error
Constructors
new DgraphClientError(errors, query, variables)
new DgraphClientError(
errors,
query,
variables): DgraphClientError
Parameters
Parameter | Type |
---|---|
errors | any [] |
query | string |
variables | any |
Returns
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
Parameter | Type |
---|---|
err | Error |
stackTraces | CallSite [] |
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
Parameter | Type |
---|---|
targetObject | object |
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
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
Parameter | Type |
---|---|
params | DgraphClientParams |
Returns
{
run: Promise<null | T>;
}
run()
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
query | string |
variables ? | Record <string , any > |
Returns
Promise
<null
| T
>