Skip to content
需要从 NextAuth.js v4 升级到最新版本吗?请查阅 版本升级指南
API 参考手册@auth/dgraph-adapter

@auth/dgraph-adapter

Official Dgraph adapter for Auth.js / NextAuth.js.

Installation

npm install next-auth @auth/dgraph-adapter

DgraphClientError

Re-exports DgraphClientError

DgraphClientParams

Re-exports DgraphClientParams

DgraphAdapterOptions

This is the interface of the Dgraph adapter options.

Properties

fragments?

optional fragments: {
  Account: string;
  Session: string;
  User: string;
  VerificationToken: string;
};

The GraphQL Fragments you can supply to the adapter to define how the shapes of the user, account, session, verificationToken entities look.

By default the adapter will uses the default defined fragments , this config option allows to extend them.

Account?
optional Account: string;
Session?
optional Session: string;
User?
optional User: string;
VerificationToken?
optional VerificationToken: string;

format

const format: {
  from: null | T;
};

Type declaration

from()

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

null | T


DgraphAdapter()

DgraphAdapter(client, options?): Adapter

Parameters

ParameterType
clientDgraphClientParams
options?DgraphAdapterOptions

Returns

Adapter