Skip to main content

Plugin Configuration

Overview​

The EventCatalog GraphQL plugin is configured in the eventcatalog.config.js file inside the generators array.

Required Configuration Options​

OptionTypeRequiredDescription
servicesService[]YesList of GraphQL schema files to add to your catalog, and the service name and version
licenseKeystringYes*License key for the plugin. Get a 14-day trial at EventCatalog Cloud. Can also be set via EVENTCATALOG_LICENSE_KEY_GRAPHQL environment variable.

Service Configuration​

Each service in the services array requires the following properties:

PropertyTypeRequiredDescription
idstringYesEventCatalog ID for the service. This is required and must be unique.
pathstringYesPath to your GraphQL schema file
versionstringYesVersion of the service. EventCatalog resources are versioned, you must specify a version for the service.
ownersstring[]NoOwners of the service. You can assign EventCatalog users or teams to services. Setting owners on the service will also set the owners of the messages in the GraphQL schema. If owners are already set on any resource, those owners are persisted.
namestringNoDisplay name for the service. If not provided, the id will be used.
summarystringNoShort summary of the service.
generateMarkdownfunction-Function to override the default markdown generation for the service. See Markdown templates for more information.

Optional Configuration Options​

OptionTypeDefaultDescription
domainobject-Domain to associate all configured services with
domain.idstring-Domain identifier
domain.namestring-Domain display name
domain.versionstring-Domain version
domain.ownersstring[]-Owners of the domain. If owners are already set on the domain, those owners are persisted.
domain.markdownstring-Custom markdown content for the domain.
messages.generateMarkdownfunction-Function to override the default markdown generation for the message. See Markdown templates for more information.
writeFilesToRootbooleanfalseWrite GraphQL messages to root instead of service folder. By default all domains, services and messages will be grouped in the folder directory structure.

Example Configuration​

eventcatalog.config.js
import path from "path";
import url from "url";

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

/** @type {import('@eventcatalog/core/bin/eventcatalog.config').Config} */
export default {
cId: "10b46030-5736-4600-8254-421c3ed56e47",
title: "GraphQL API Catalog",
tagline: "Your GraphQL API Documentation",
organizationName: "Your Organization",
homepageLink: "https://eventcatalog.dev/",
editUrl: "https://github.com/your-org/your-catalog/edit/master",
trailingSlash: false,
base: "/",
logo: {
alt: "EventCatalog Logo",
src: "/logo.png",
text: "Your Organization",
},
docs: {
sidebar: {
showPageHeadings: true,
},
},
generators: [
[
'@eventcatalog/generator-graphql',
{
services: [
{
id: 'User Service',
version: '1.0.0',
name: 'User Service',
path: path.join(__dirname, 'graphql-schemas', 'user-service.graphql'),
owners: ['team-users']
},
{
id: 'Order Service',
version: '1.2.0',
name: 'Order Service',
path: path.join(__dirname, 'graphql-schemas', 'order-service.graphql'),
owners: ['team-orders']
},
],
domain: { id: 'ecommerce', name: 'E-commerce', version: '0.0.1' },
},
],
[
'@eventcatalog/generator-graphql',
{
services: [
{
id: 'Analytics Service',
version: '3.0.0',
name: 'Analytics Service',
path: path.join(__dirname, 'graphql-schemas', 'analytics-service.graphql'),
draft: true
},
],
domain: { id: 'analytics', name: 'Analytics', version: '0.0.1' },
debug: true
},
],
],
};

You can view an example configuration in the EventCatalog GraphQL plugin GitHub repository.