@valtimo-plugins/hasura-plugin
v1.3.0
Published
Angular plugin library for the [Hasura Plugin](../../backend/plugin) in the Valtimo platform. Provides configuration UI components for all Hasura plugin actions.
Readme
@valtimo-plugins/hasura-plugin
Angular plugin library for the Hasura Plugin in the Valtimo platform. Provides configuration UI components for all Hasura plugin actions.
Installation
npm install @valtimo-plugins/hasura-pluginRegister in your app module
import { HasuraPluginModule } from '@valtimo-plugins/hasura-plugin';
import { hasuraPluginSpecification } from '@valtimo-plugins/hasura-plugin';
import { PLUGINS_TOKEN } from '@valtimo/plugin';
@NgModule({
imports: [
HasuraPluginModule,
// ...
],
providers: [
{
provide: PLUGINS_TOKEN,
useValue: [hasuraPluginSpecification],
},
],
})
export class AppModule {}Plugin configuration
| Property | Type | Secret | Description |
|--------------------|----------|--------|--------------------------------------------------|
| hasuraUrl | string | No | Base URL of the Hasura GraphQL Engine (e.g. http://localhost:8080) |
| hasuraAdminSecret| string | Yes | Admin secret used in the X-Hasura-Admin-Secret header |
Actions
graphql-by-input — GraphQL by Input
Executes an arbitrary GraphQL query with optional static variables and stores the result in a process variable.
| Property | Type | Required | Description |
|---------------------------|----------|----------|----------------------------------------------------|
| query | string | Yes | GraphQL query string |
| variables | string | No | Variables as a JSON string |
| resultProcessVariableName | string | Yes | Process variable name where the result is stored |
mutation-by-process-variable — Mutation by Process Variable
Executes a GraphQL mutation, passing the value of a process variable as the $objects variable. The process variable may be a JSON string (serialized by a script task) or a direct object.
| Property | Type | Required | Description |
|-----------------------------|----------|----------|-----------------------------------------------------------------|
| mutation | string | Yes | GraphQL mutation string; must declare $objects as a variable |
| objectsVariableName | string | Yes | Name of the process variable containing the objects to insert |
| resultProcessVariableName | string | No | Process variable where the mutation result is stored |
Development setup
This library is built with ng-packagr. To build:
ng build @valtimo-plugins/hasura-plugin
# output: projects/plugin/dist/