Version: 0.15.x

GraphbackPlugin

Graphback plugin interface Plugins are base for every graphback generator and schema transformers. See documentation for the complete list of the plugins.

Plugins can:

  • Modify the schema
  • Create resources like files, db tables etc.
  • Perform some in memory operations based on configuration

Hierarchy

  • GraphbackPlugin

Index

Methods

Methods

createResolvers

createResolvers(metadata: GraphbackCoreMetadata): IResolvers

Defined in packages/graphback-core/src/plugin/GraphbackPlugin.ts:42

Method to create in-memory resolvers which will be added to a list of resolvers output by Graphback

Parameters:

NameTypeDescription
metadataGraphbackCoreMetadatametadata object with model metadata

Returns: IResolvers


createResources

createResources(metadata: GraphbackCoreMetadata): void

Defined in packages/graphback-core/src/plugin/GraphbackPlugin.ts:32

Create resources like files etc. for this plugin. This method should write resouces to filesystem

Parameters:

NameType
metadataGraphbackCoreMetadata

Returns: void


Abstract getPluginName

getPluginName(): string

Defined in packages/graphback-core/src/plugin/GraphbackPlugin.ts:59

Returns: string

Unique name of the plugin


Protected logError

logError(message: string): void

Defined in packages/graphback-core/src/plugin/GraphbackPlugin.ts:51

Parameters:

NameType
messagestring

Returns: void


Protected logWarning

logWarning(message: string): void

Defined in packages/graphback-core/src/plugin/GraphbackPlugin.ts:46

Parameters:

NameType
messagestring

Returns: void


transformSchema

transformSchema(metadata: GraphbackCoreMetadata): GraphQLSchema

Defined in packages/graphback-core/src/plugin/GraphbackPlugin.ts:24

Performs transformation on the schema and returns target schema Implementations should extend this method if they wish to apply some changes to schema. Otherwise unchanged schema should be returned

Parameters:

NameTypeDescription
metadataGraphbackCoreMetadatametadata object containing schema

Returns: GraphQLSchema