npm @trpc/server 9.22.0
v9.22.0

latest releases: 11.0.0-rc.436, 11.0.0-rc.435, 11.0.0-rc.433...
2 years ago

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

Don't miss a new server release

NewReleases is sending notifications on new releases.