twentyhq/twenty · error · Error

No response from server

Error message

No response from server

What it means

Thrown inside useTestHttpRequest when the Apollo `testHttpRequest` mutation resolves but `result.data.testHttpRequest` is undefined/falsy. The request did not surface a server-side error (no GraphQL error thrown by Apollo), yet no payload came back, indicating a partial/empty response or a selection-set/codegen mismatch.

Source

Thrown at packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/hooks/useTestHttpRequest.ts:105

          ? substitutedBodyRaw
          : undefined;

      const input: TestHttpRequestInput = {
        url: substitutedUrl as string,
        method: httpRequestFormData.method,
        headers: substitutedHeaders as Record<string, string>,
        body: substitutedBody,
      };

      const result = await mutate({
        variables: { input },
      });

      const duration = Date.now() - startTime;
      const response = result?.data?.testHttpRequest;

      if (!response) {
        throw new Error('No response from server');
      }

      if (response.success === true) {
        const resultData = isString(response.result)
          ? response.result
          : JSON.stringify(response.result, null, 2);
        const language = isObject(response.result) ? 'json' : 'plaintext';

        setHttpRequestTestData((prev) => ({
          ...prev,
          output: {
            data: resultData,
            status: response.status ?? 200,
            statusText: response.statusText ?? 'OK',
            headers: response.headers ?? {},
            duration,
            error: undefined,
          },

View on GitHub (pinned to 1f5dd2bbd2)

Solutions

  1. Check the network response in DevTools for the testHttpRequest query and inspect both data and errors.
  2. Re-run `npx nx run twenty-front:graphql:generate` to resync operation documents with the schema.
  3. Verify the backend testHttpRequest resolver is not silently returning null on caught errors.

Example fix

const response = result?.data?.testHttpRequest;
// before: if (!response) { throw new Error('No response from server'); }
// after:  if (!response) {
//           throw new Error(result?.errors?.[0]?.message ?? 'No response from server');
//         }
Defensive patterns

Strategy: try-catch

Validate before calling

const hasTestHttpRequestPayload = (r: typeof result): boolean =>
  isDefined(r?.data?.testHttpRequest);

Type guard

type TestHttpResp = NonNullable<NonNullable<TestHttpRequestMutation['testHttpRequest']>>;
const isTestHttpResponse = (v: unknown): v is TestHttpResp =>
  typeof v === 'object' && v !== null && 'success' in v;

Try / catch

// already wrapped in try/catch in the hook; enrich the 'No response' branch:
if (!response) {
  throw new Error(result?.errors?.[0]?.message ?? 'No response from server');
}

Prevention

When it happens

Trigger: GraphQL response returns 200 with the testHttpRequest field missing from data (e.g., only partial data due to a server exception caught into the errors array that Apollo swallowed). Apollo cache returns a stale object without the field. Codegen drift where the selection set no longer matches the operation document.

Common situations: Network hiccup producing a partial response. Server-side exception during the outbound HTTP probe that the resolver catches and returns as `{ data: null }`. Mismatched generated GraphQL types after a schema change without re-running graphql:generate.

Related errors


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