Action that executes GraphQL queries and mutations

Example

// Simple query
await runAction({
ActionName: 'GraphQL Query',
Params: [{
Name: 'Endpoint',
Value: 'https://api.example.com/graphql'
}, {
Name: 'Query',
Value: `
query GetUser($id: ID!) {
user(id: $id) {
id
name
email
}
}
`
}, {
Name: 'Variables',
Value: { id: '123' }
}]
});

// Mutation with headers
await runAction({
ActionName: 'GraphQL Query',
Params: [{
Name: 'Endpoint',
Value: 'https://api.example.com/graphql'
}, {
Name: 'Query',
Value: `
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
name
}
}
`
}, {
Name: 'Variables',
Value: {
input: {
name: 'John Doe',
email: 'john@example.com'
}
}
}, {
Name: 'Headers',
Value: {
'Authorization': 'Bearer token123'
}
}]
});

Hierarchy (view full)

Constructors

Methods

  • Executes the action with the provided parameters.

    Parameters

    • params: RunActionParams<any>

      The action execution parameters including context

    Returns Promise<ActionResultSimple>

    Promise resolving to the action result