github trpc/trpc v9.22.0

latest releases: v10.45.2, v10.45.1, v11.0.0-next-beta.0...
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 trpc release

NewReleases is sending notifications on new releases.