twentyhq/twenty · error · Error

${caller}() failed: response contained no data.

Error message

${caller}() failed: response contained no data.

What it means

Thrown by postGraphqlRequest when the HTTP response is 200 OK, there are no GraphQL errors in the body, but the body.data field is falsy (null or undefined). This is a protocol-level anomaly — a successful GraphQL response should always contain data. Its absence suggests a server bug, an unexpected response format, or a proxy that stripped the data field.

Source

Thrown at packages/twenty-sdk/src/sdk/logic-function/utils/post-graphql-request.util.ts:52

  if (!response.ok) {
    throw new Error(
      `${caller}() failed: HTTP ${response.status} ${response.statusText}`,
    );
  }

  const body = (await response.json()) as {
    data?: TData;
    errors?: { message: string }[];
  };

  if (body.errors && body.errors.length > 0) {
    throw new Error(
      `${caller}() failed: ${body.errors.map((error) => error.message).join(', ')}`,
    );
  }

  if (!body.data) {
    throw new Error(`${caller}() failed: response contained no data.`);
  }

  return body.data;
};

View on GitHub (pinned to 1f5dd2bbd2)

Solutions

  1. Retry the request — if intermittent, it may be a transient server or proxy issue.
  2. Log the full response body to inspect what the server actually returned.
  3. Check if a proxy, load balancer, or API gateway is modifying the response.
  4. Report to the Twenty platform team if the issue persists — this likely indicates a server bug.
  5. Verify the Twenty server version is up-to-date and compatible with the SDK version.
Defensive patterns

Strategy: retry

Try / catch

const requestWithData = async <T>(
  params: { query: string; variables: unknown; caller: string },
  retries = 2,
): Promise<T> => {
  for (let attempt = 0; attempt <= retries; attempt++) {
    try {
      return await postGraphqlRequest(params);
    } catch (error) {
      if (error instanceof Error && error.message.includes('no data') && attempt < retries) {
        await new Promise((r) => setTimeout(r, 500 * (attempt + 1)));
        continue;
      }
      throw error;
    }
  }
  throw new Error('unreachable');
};

Prevention

When it happens

Trigger: The metadata endpoint returns a 200 response with a body that has no errors array but also no data field. This can happen if the server returns an empty body, a malformed JSON response, or a response where data is explicitly null without a corresponding errors array (which violates the GraphQL spec).

Common situations: A reverse proxy or API gateway strips or rewrites the response body. The Twenty server has a bug returning a malformed response. A network middleware corrupts the response. The server returned a 200 with an empty or non-JSON body that was coerced. This is rare and usually indicates a server-side or infrastructure issue.

Related errors


AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12). Data as JSON: /api/errors/982f240eebd20768. Report an issue: GitHub.