Skip to content

v2 Wraps responses in json object #48

@Lemour-sudo

Description

@Lemour-sudo

I have just noticed that v2 now wraps the object data in an object under a "json" key when using superjson as the transformer.

Is there a way to return the data object as it is unwrapped to avoid the client from having to extract it from the json key?

This is how I am currently setting up trpcMsw:

const trpcMsw = createTRPCMsw<AppRouter>({
    links: [httpLink({ url: `http://${baseUrl}` })],
    transformer: {
        input: superjson,
        output: superjson,
    },
});

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