GraphiqlPlugin
GraphiqlPlugin
This plugin provides a GraphiQL UI for exploring and testing the Vendure GraphQL APIs.
It adds routes /graphiql/admin
and /graphiql/shop
which serve the GraphiQL interface
for the respective APIs.
Installation
import { GraphiQLPlugin } from '@vendure/graphiql-plugin';
const config: VendureConfig = {
// Add an instance of the plugin to the plugins array
plugins: [
GraphiQLPlugin.init({
route: 'graphiql', // Optional, defaults to 'graphiql'
}),
],
};
Signature
class GraphiqlPlugin implements NestModule {
static options: Required<GraphiqlPluginOptions>;
constructor(processContext: ProcessContext, configService: ConfigService, graphiQLService: GraphiQLService)
init(options: GraphiqlPluginOptions = {}) => Type<GraphiqlPlugin>;
configure(consumer: MiddlewareConsumer) => ;
}
- Implements:
NestModule
options
property
Required<GraphiqlPluginOptions>
constructor
method
(processContext: ProcessContext, configService: ConfigService, graphiQLService: GraphiQLService) => GraphiqlPlugin
init
method
(options: GraphiqlPluginOptions = {}) => Type<GraphiqlPlugin>
configure
method
(consumer: MiddlewareConsumer) =>