---
title: "Execute a GraphQL query or mutation"
method: POST
path: "/graphql"
tags: ["graphql"]
---

# Execute a GraphQL query or mutation

`POST /graphql`

Executes a single GraphQL operation. The available operations cover users, mentors, matching, bookings, conversations, goals, reviews, surveys, and program analytics. Consult https://mentorly.com/developers for the full schema reference with per-operation descriptions, or https://mentorly.com/developers.md for a condensed markdown version.

## Headers

- `X-Group-Id` string

## Request body

- GraphQLRequest
  - `query` string, required — GraphQL query or mutation document.
  - `operationName` string — Name of the operation to execute when the document contains more than one.
  - `variables` object — Values for variables declared by the operation.

## Response `200`

GraphQL result. May contain `data`, `errors`, or both. Mutation payloads additionally expose `errors: [String]` and `errorDetails: JSON` fields for handled business-rule failures; content in those fields means the mutation did not succeed even though HTTP status is 200.

- GraphQLResponse
  - `data` object, nullable — Result of the operation. Null or absent when the request failed before execution.
  - `errors` GraphQLError[] — Request-level failures such as authorization or validation problems.
    - `message` string, required
    - `path` union[]
      - union
        - string
        - integer
    - `extensions` object
      - `code` 'VALIDATION_ERROR' | 'unauthorized' | 'forbidden' | 'NOT_FOUND_ERROR' — Machine-readable error code.
      - `details` object, nullable — Validation messages when code is VALIDATION_ERROR.

## Other responses

- `401` — Missing or invalid API key.
- `429` — Rate limit exceeded. Back off until the reset time indicated by Retry-After before retrying.

---

[API](https://skmtc.dev/mentorly/apis/mentorly-graphql-api.md) · [All operations](https://skmtc.dev/mentorly/apis/mentorly-graphql-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mentorly/mentorly-graphql-api/revisions/fe0b6c953b0c/schema)
