Version: 0.16.x

ClientCRUDPlugin

Graphback CRUD operations plugin

Plugins generates client side documents containing CRUD operations: Queries, Mutations and Subscriptions that reference coresponding schema and resolves. Plugin operates on all types annotated with model

Used graphql metadata:

  • model: marks type to be processed by CRUD generator
  • crud: controls what types of operations can be generated. For example crud.update: false will disable updates for type

Hierarchy#

  • GraphbackPlugin

    ClientCRUDPlugin

Index#

Constructors#

Properties#

Methods#

Constructors#

constructor#

+ new ClientCRUDPlugin(pluginConfig?: ClientGeneratorPluginConfig): ClientCRUDPlugin

Defined in graphback-codegen-client/src/ClientCRUDPlugin.ts:40

Parameters:

NameType
pluginConfig?ClientGeneratorPluginConfig

Returns: ClientCRUDPlugin

Properties#

Private pluginConfig#

pluginConfig: ClientGeneratorPluginConfig

Defined in graphback-codegen-client/src/ClientCRUDPlugin.ts:40

Methods#

createResolvers#

createResolvers(metadata: GraphbackCoreMetadata): IResolvers

Inherited from ClientCRUDPlugin.createResolvers

Defined in graphback-core/types/plugin/GraphbackPlugin.d.ts:35

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

Overrides void

Defined in graphback-codegen-client/src/ClientCRUDPlugin.ts:50

Parameters:

NameType
metadataGraphbackCoreMetadata

Returns: void


getDocuments#

getDocuments(metadata: GraphbackCoreMetadata): ClientTemplates

Defined in graphback-codegen-client/src/ClientCRUDPlugin.ts:60

Parameters:

NameType
metadataGraphbackCoreMetadata

Returns: ClientTemplates


getPluginName#

getPluginName(): string

Overrides void

Defined in graphback-codegen-client/src/ClientCRUDPlugin.ts:56

Returns: string


Protected logError#

logError(message: string): void

Inherited from ClientCRUDPlugin.logError

Defined in graphback-core/types/plugin/GraphbackPlugin.d.ts:37

Parameters:

NameType
messagestring

Returns: void


Protected logWarning#

logWarning(message: string): void

Inherited from ClientCRUDPlugin.logWarning

Defined in graphback-core/types/plugin/GraphbackPlugin.d.ts:36

Parameters:

NameType
messagestring

Returns: void


transformSchema#

transformSchema(metadata: GraphbackCoreMetadata): GraphQLSchema

Inherited from ClientCRUDPlugin.transformSchema

Defined in graphback-core/types/plugin/GraphbackPlugin.d.ts:23

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