Skip to content

v9.22.0

Compare
Choose a tag to compare
@KATT KATT released this 07 Apr 22:14
· 1936 commits to main since this release

What's Changed

✨ Route metadata

feat(server): route metadata by @LouisHaftmann in #1751

Docs

https://trpc.io/docs/metadata

Example

interface Context {
  // ...
}
interface Meta {
  data: string;
}

export const appRouter = trpc
  .router<
    Context,
    /* <✨✨✨> */
    Meta
    /* </✨✨✨> */
  >()
  .query('query', {
    /* <✨✨✨> */
    meta: {
      data: 'foo',
    },
    /* </✨✨✨> */
    async resolve({ input }) {
      return { input };
    },
  })

New Contributors

Full Changelog: v9.21.0...v9.22.0