Member Junction
    Preparing search index...

    Client for executing actions and entity actions through GraphQL. This class provides an easy way to execute actions from a client application, similar to how the ActionEngine and EntityActionEngine work on the server.

    The GraphQLActionClient follows the same naming convention as other GraphQL clients in the MemberJunction ecosystem, such as GraphQLSystemUserClient.

    // Create the client
    const actionClient = new GraphQLActionClient(graphQLProvider);

    // Run a regular action
    const result = await actionClient.RunAction("action-id", [
    { Name: "parameter1", Value: "value1", Type: "Input" }
    ]);

    // Run an entity action
    const entityActionResult = await actionClient.RunEntityAction({
    EntityAction: action,
    InvocationType: { Name: "SingleRecord" },
    EntityObject: entityObject,
    ContextUser: user
    });
    Index

    Constructors

    Methods

    • Run an action by its ID with the specified parameters.

      This method invokes an action on the server through GraphQL and returns the result. Action parameters are automatically serialized as needed, and results are deserialized for complex data types.

      Parameters

      • actionID: string

        The ID of the action to run

      • Optionalparams: ActionParam[]

        Optional parameters to pass to the action

      • skipActionLog: boolean = false

        Whether to skip logging the action execution (defaults to false)

      Returns Promise<ActionResult>

      A Promise that resolves to an ActionResult object containing the result of running the action

      const result = await actionClient.RunAction("action-id", [
      { Name: "param1", Value: "value1", Type: "Input" }
      ]);

      if (result.Success) {
      // Action was successful
      console.log(result.Message);
      }
    • Run an entity action with the specified parameters.

      This method invokes an entity action on the server through GraphQL and returns the result. Entity actions are operations that can be performed on entity records, such as validation, business logic, or custom processing. They can operate on a single record, a view, or a list.

      Parameters

      • params: EntityActionInvocationParams

        The parameters for the entity action, including the action to run, invocation type, entity object or view/list IDs, and optional parameters

      Returns Promise<EntityActionResult>

      A Promise that resolves to an EntityActionResult object containing the result

      // Run an entity action on a single record
      const result = await actionClient.RunEntityAction({
      EntityAction: action,
      InvocationType: { Name: "SingleRecord" },
      EntityObject: entityObject,
      ContextUser: user
      });

      // Run an entity action on a view
      const viewResult = await actionClient.RunEntityAction({
      EntityAction: action,
      InvocationType: { Name: "View" },
      ViewID: "view-id",
      ContextUser: user
      });