> For the complete documentation index, see [llms.txt](https://developers.make.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.make.com/custom-apps-documentation/app-components/modules/universal-module/graphql.md). Agents can also search and read this documentation through its [MCP server](https://developers.make.com/~gitbook/mcp).

# GraphQL

## **Naming Convention**

All GraphQL universal modules should have the following module label and description:

* **Module label**: Execute a GraphQL query
* **Module description**: Performs an arbitrary authorized GraphQL query.

When you create the module, fill in the **Create module** dialog as follows:

| Field           | Value                                                                  |
| --------------- | ---------------------------------------------------------------------- |
| **Type**        | Universal                                                              |
| **Subtype**     | GraphQL                                                                |
| **Name**        | Any name that is unique in your app, for example `executeGraphQLQuery` |
| **Label**       | Execute a GraphQL query                                                |
| **Description** | Performs an arbitrary authorized GraphQL query.                        |

{% tabs %}
{% tab title="Appearance" %}

<div align="left"><img src="https://1562974717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNS0mCBwODiYtOVXjc6qf%2Fuploads%2Fgit-blob-219f83051a315146c04bd41960749adde5830d4d%2Fgraphql_module.png?alt=media" alt="" width="539"></div>
{% endtab %}

{% tab title="Communication" %}

```json
{
    "url": "https://www.example.com/graphql",
    "method": "{{parameters.method}}",
    "qs": {
		"query": "{{parameters.queryQs}}"
	},
    "headers": {
		"Content-Type": "application/json"
	},
	"body": {
		"query": "{{parameters.queryBody}}",
		"operationName": "{{parameters.operationName}}",
		"variables": "{{if(isArray(parameters.variables), toCollection(parameters.variables, 'key', 'value'), parameters.variables)}}"
	},
	"type": "json",
    "response": {
        "output": {
            "headers": "{{headers}}",
            "body": "{{body}}",
			"statusCode": "{{statusCode}}"
        }
    }
}
```

{% endtab %}

{% tab title="Static parameters" %}
![](https://1562974717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNS0mCBwODiYtOVXjc6qf%2Fuploads%2Fgit-blob-24db6b771ccbdb1b438811fa47e149be70ed4961%2FexampleGraphqlStaticParams.png?alt=media)
{% endtab %}

{% tab title="Mappable parameters" %}

```json
[
    {
        "name": "method",
        "type": "select",
        "label": "Method",
        "required": true,
        "default": "POST",
        "options": [
            {
                "label": "GET (introspection query)",
                "value": "GET",
				"nested": [
					{
						"name": "queryQs",
						"label": "Query",
						"type": "text",
						"required": true
					}
				]
            },
            {
                "label": "POST (queries and mutations)",
                "value": "POST",
				"nested": [
					{
						"name": "queryBody",
						"label": "Query",
						"type": "text",
						"required": true
					},
					{
						"name": "operationName",
						"label": "Operation name",
						"type": "text",
						"advanced": true
					},
					{
						"name": "variablesDataSource",
						"label": "Variables data source",
						"type": "select",
						"required": true,
						"advanced": true,
						"default": "array",
						"options": [
							{
								"value": "array",
								"label": "Form",
								"nested": [
									{
										"name": "variables",
										"label": "Variables",
										"type": "array",
										"mappable": {
											"help": "Key-Value pairs as an Array of Collections e.g. `[{key:id,value:123},{key:name,value:'John'},…]`"
										},
										"spec": [
											{
												"name": "key",
												"label": "Key",
												"type": "text"
											},
											{
												"name": "value",
												"label": "Value",
												"type": "text"
											}
										]
									}
								]
							},
							{
								"value": "object",
								"label": "Collection",
								"nested": [
									{
										"name": "variables",
										"label": "Variables",
										"help": "A single Collection e.g. `{id:123,name:'John', …}`",
										"type": "any"
									}
								]
							}
						]
					}
				]
            }
        ]
    }
]
```

{% endtab %}

{% tab title="Interface" %}

```json
[
	{
		"name": "body",
		"type": "any",
		"label": "Body"
	},
	{
		"name": "headers",
		"type": "collection",
		"label": "Headers"
	},
	{
		"name": "statusCode",
		"type": "number",
		"label": "Status code"
	}
]
```

{% endtab %}

{% tab title="Samples" %}

```json
{}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.make.com/custom-apps-documentation/app-components/modules/universal-module/graphql.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
