AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { createAction, Property } from '@activepieces/pieces-framework';
import { githubAuth } from '../auth';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { githubAuthHelpers, GithubAuthValue } from '../common/auth-helpers';
export const githubRawGraphqlQuery = createAction({
name: 'rawGraphqlQuery',
classification: 'WRITE',
displayName: 'Raw GraphQL Query',
description: 'Sends a GraphQL query or mutation to GitHub.',
audience: 'both',
aiMetadata: {
description:
"Sends an arbitrary GraphQL query or mutation to GitHub's GraphQL API with optional variables. Use as an escape hatch when no dedicated action covers the needed operation. Idempotency depends entirely on the query you pass — a read query is safe to repeat, a mutation is not.",
idempotent: false,
},
auth: githubAuth,
props: {
query: Property.LongText({
displayName: 'Query',
description: 'A query or mutation in GraphQL syntax.',
placeholder: 'query { viewer { login } }',
required: true,
}),
variables: Property.Object({
displayName: 'Variables',
description: 'Values for the $variables your query declares.',
required: false,
}),
},
propertyGroups: [
{
key: 'request',
display: 'section',
label: 'GraphQL request',
icon: 'code',
props: ['query', 'variables'],
},
],
async run({ auth, propsValue }) {
const token = await githubAuthHelpers.getBearerToken(
auth as GithubAuthValue
);
const response = await httpClient.sendRequest({
url: 'https://api.github.com/graphql',
method: HttpMethod.POST,
headers: {
Authorization: `Bearer ${token}`,
},
body: JSON.stringify({
query: propsValue.query,
variables: propsValue.variables,
}),
});
return response;
},
});