GraphQL Debugger Adapters
GraphQL Debugger's storage layer is pluggable, GraphQL Debugger contains a few adapters out of the box, but you can also write your own.
Base Adapter
The Base Adapter is the interface that all adapters must implement. It contains entities such as: Spans, Traces and Schemas and exposes extendable methods to interact with them. To learn more about The Base Adapter check out the @graphql-debugger/adapter-base
lib.
Proxy Adapter
The Proxy Adapter will forward all read and writes over the GraphQL Schema and to the Collector, this is what most will use pointing to a local or remote instance of Debugger.
Getting Started
Install
npm install @graphql-debugger/adapter-proxy
Usage
import { ProxyAdapter } from '@graphql-debugger/adapter-proxy'
const adapter = new ProxyAdapter({
apiURL: 'http://localhost:16686',
collectorURL: 'http://localhost:4318'
});
// or if you want to use the default values
const adapter = new ProxyAdapter();
SQLite Adapter
This is used locally when you use the CLI, It is a simple SQLite database that stores all the data locally. This is not recommended for production use.
Getting Started
Install
npm install @graphql-debugger/adapter-sqlite
Usage
import { SQLiteAdapter } from "@graphql-debugger/adapter-sqlite";
const adapter = new SQLiteAdapter();
Note that SQLite Adapter will use Prisma thru to SQLite. The database will be created in the
node_modules/@graphql-debugger/data-access/prisma/dev.db
.