The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import gql from 'graphql-tag';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
import { type UpdateAgentInput } from 'src/engine/metadata-modules/ai/ai-agent/dtos/update-agent.input';
export type UpdateOneAgentFactoryInput = UpdateAgentInput;
const DEFAULT_AGENT_GQL_FIELDS = `
id
name
label
icon
description
prompt
modelId
responseFormat
roleId
applicationId
modelConfiguration
triggers
createdAt
updatedAt
`;
export const updateOneAgentQueryFactory = ({
gqlFields = DEFAULT_AGENT_GQL_FIELDS,
input,
}: PerformMetadataQueryParams<UpdateOneAgentFactoryInput>) => ({
query: gql`
mutation UpdateOneAgent($input: UpdateAgentInput!) {
updateOneAgent(input: $input) {
${gqlFields}
}
}
`,
variables: {
input,
},
});