Skip to content

Incorrect method type when using @trpc/*@^11 packages #7

Description

@idmontie

Issue

If you are using the latest version of tRPC, the key for the operation is set incorrectly in the returned data from generateOpenAPIDocumentFromTRPCRouter.

For example: if you have a query, it is returning that as post.

Root cause

In the latest version of tRPC, this line: https://github.com/dtinth/openapi-trpc/blob/main/src/generate.ts#L84 no longer works. query was removed and replaced with type: 'query' | 'mutation' | 'subscription'.

I'm not sure what subscription should be mapped to, but procDef.type === 'query' would be map to the old procDef.query check.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions