Creates a new GraphQLActionClient instance.
The GraphQL data provider to use for queries
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.
The ID of the action to run
Optionalparams: ActionParam[]Optional parameters to pass to the action
Whether to skip logging the action execution (defaults to false)
A Promise that resolves to an ActionResult object containing the result of running the action
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.
The parameters for the entity action, including the action to run, invocation type, entity object or view/list IDs, and optional parameters
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
});
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.
Example