| 4 | import type { HeadersInit } from "node-fetch" |
| 5 | |
| 6 | export interface DgraphClientParams { |
| 7 | endpoint: string |
| 8 | /** |
| 9 | * `X-Auth-Token` header value |
| 10 | * |
| 11 | * [Dgraph Cloud Authentication](https://dgraph.io/docs/cloud/cloud-api/overview/#dgraph-cloud-authentication) |
| 12 | */ |
| 13 | authToken: string |
| 14 | /** [Using JWT and authorization claims](https://dgraph.io/docs/graphql/authorization/authorization-overview#using-jwts-and-authorization-claims) */ |
| 15 | jwtSecret?: string |
| 16 | /** |
| 17 | * @default "RS256" |
| 18 | * |
| 19 | * [Using JWT and authorization claims](https://dgraph.io/docs/graphql/authorization/authorization-overview#using-jwts-and-authorization-claims) |
| 20 | */ |
| 21 | jwtAlgorithm?: "HS256" | "RS256" |
| 22 | /** |
| 23 | * @default "Authorization" |
| 24 | * |
| 25 | * [Using JWT and authorization claims](https://dgraph.io/docs/graphql/authorization/authorization-overview#using-jwts-and-authorization-claims) |
| 26 | */ |
| 27 | authHeader?: string |
| 28 | } |
| 29 | |
| 30 | export class DgraphClientError extends Error { |
| 31 | name = "DgraphClientError" |
nothing calls this directly
no outgoing calls
no test coverage detected