List plans
Read the action plans in a datastore.
useActionPlans lists action plans for the datastore the Manta providers are connected to.
What it is
The hook returns one page of plans and how many match the filters. While any plan on the page is RUNNING, it
refetches every three seconds, unless you pass your own refetchInterval.
Import
import { useActionPlans } from "@manta-eu/react/hooks/useActionPlans";
Example
const { plans, count, isLoading, error } = useActionPlans(client, { limit: 20 });
Request
useActionPlans(client, variables?, options?)
client is a GraphQLClient. The hook accepts it and leaves it unused. Plans are read through the providers’ SPARQL
connection.
variables:
searchorderBy, withfield(STATEorMANTA_PRIORITY) anddirection(ASCorDESC)limitoffsetstates:DRAFT,RUNNING,COMPLETED,FAILED, orTIMED_OUTgraphIrisintegrations:META,GOOGLE,LINKEDIN,SHOPIFY,SNAPCHAT,WOOCOMMERCE, orNONElastRunFromandlastRunToapproval:NEEDS_APPROVALorNO_PENDINGavailability:CURRENT,PAST_RUNS_ONLY, orALL
options: enabled, and refetchInterval as a number of milliseconds or false.
Response
planscountisLoadingisPlaceholderDataerror, a string ornull
Each plan has iri, hasCurrentFacts, state, statements, subjects, updatedAt, lastRunAt, dryRun,
description, duration, primaryIntegration, actionCount, completedActionCount, and actionCountByType
(typeName and count). updatedAt is always null.