Run a GraphQL request with the given query and variables.
Args:
graphql_query (str): The GraphQL query to execute. This should be a valid GraphQL query string.
variables (str, optional): A JSON string containing variables for the GraphQL query. If provided, this must be a valid JSON string.
Example (as a string):
'{"pageInput": {"page_num": 1, "page_size": 5}, "op_id": "abc123"}'
Example (for a query with variables):
query weaknesses_page($pageInput: PageInput, $op_id: String!) {
weaknesses_page(pageInput: $pageInput, op_id: $op_id) {
weaknesses { id title severity }
}
}
Pass variables as:
'{"pageInput": {"page_num": 1, "page_size": 10}, "op_id": "abc123"}'
Returns:
Dict with output and status. The output field contains the GraphQL response.
Notes:
- If variables cannot be passed as a separate parameter due to MCP limitations, you can embed them directly in your query using variable definitions.
- If the variables parameter is not a valid JSON string, a clear error message will be returned.