Skip to content

The open alternative to Salesforce, designed for AI.

722 B
Raw Blame
import gql from 'graphql-tag';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';

const DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS = `
  id
  workflowVersionId
  engineComponentKey
  label
  icon
  isPinned
  availabilityType
  availabilityObjectMetadataId
  navigationTargetObjectMetadataId
  payload {
    ... on PathCommandMenuItemPayload {
      path
    }
  }
  applicationId
  createdAt
  updatedAt
`;

export const findCommandMenuItemsQueryFactory = ({
  gqlFields = DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS,
}: PerformMetadataQueryParams<void>) => ({
  query: gql`
    query CommandMenuItems {
      commandMenuItems {
        ${gqlFields}
      }
    }
  `,
});