Class AccessTrait

The Access Trait provides an extra GraphQL Query field for performing the entity access check.

Usage:

traits:
- type: access

Hierarchy

Constructors

Properties

Trait instance configuration.

_global: boolean = false

Whether this is a global (not bound to any specific schema item) trait instance.

_type?: "access"

Trait type.

accessControl: AccessControl
dataSourceWrapper: DataSourceWrapper
graphQlSchemaManager: GraphQLSchemaManager

Methods

  • This method is triggered when a trait callback has been activated

    Type Parameters

    • RT = any

    • Payload = any

    Parameters

    • callbackName: string

      This is the name of the callback function to call.

    • datasourceWrapper: DataSourceWrapper

      References to the Graph Hanlder

    • data: TraitDataObject<RT, Payload, Promise<any>>

      Request data passed along as part of the request.

    Returns Promise<RT>

  • This method is used to retrieve additions to the GraphQL schema and to register the callbacks associated to the Vertex.

    TODO: Remove resolvers assignment; this hook should only return a schema string. Resolvers (or 'handlers' should be defined and retrieved via separate hook).

    Returns

    • GraphQL schema with trait schema appended.

    Parameters

    • Rest ...__namedParameters: [schemaString: string, source: string, relationship?: null | object]

    Returns string

  • Parameters

    • schemaItemName: string

    Returns string

Generated using TypeDoc