Dokploy / Dokploy/cli

GET (query) requests don't wrap input in {json: ...}, breaking every parameterized read against tRPC servers using the superjson transformer

Open Beginner friendly
#46 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
152
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Bug

apiPost in dist/client.js correctly wraps mutation payloads as { json: data } before sending, matching tRPC's superjson transformer convention:

export async function apiPost(endpoint, data) {
    const client = createClient();
    const response = await client.post(`/trpc/${endpoint}`, data ? { json: data } : undefined);
    ...
}

apiGet does not — it sends the raw params object as the query string, unwrapped:

export async function apiGet(endpoint, params) {
    const client = createClient();
    const query = params
        ? `?input=${encodeURIComponent(JSON.stringify(params))}`
        : "";
    ...
}

Against a Dokploy server using the superjson transformer, any query procedure that requires input parameters fails with a 400:

{
  "error": {
    "json": {
      "message": "[\n  {\n    \"expected\": \"object\",\n    \"code\": \"invalid_type\",\n    \"path\": [],\n    \"message\": \"Invalid input: expected object, received undefined\"\n  }\n]",
      "code": -32600,
      "data": { "code": "BAD_REQUEST", "httpStatus": 400, "path": "application.one", ... }
    }
  }
}

Repro

dokploy application one --applicationId <id>
# Request failed with status code 400

No-argument queries (e.g. project all) work fine, since an empty/undefined input happens to satisfy those procedures' schemas either way — which is why this doesn't show up immediately.

Expected

apiGet should wrap params the same way apiPost wraps data:

const query = params
    ? `?input=${encodeURIComponent(JSON.stringify({ json: params }))}`
    : "";

Environment

  • @dokploy/cli 0.29.4 (reports dokploy --version → 0.3.0)
  • Dokploy server v0.29.11
  • Affects any query command that takes parameters: application one, deployment all, mounts list-by-service-id, log reads, etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dist/client.js by comparing apiGet with the existing apiPost request construction, then run the reported dokploy application one command with a parameterized query. Done means parameterized GET requests succeed against tRPC servers using superjson, while no-argument queries continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, cli
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
86/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.