wobsoriano / trpc-nuxt

End-to-end typesafe APIs in Nuxt applications.
trpc-nuxt.vercel.app
MIT License
687 stars 39 forks source link

Wrong typing in HttpBatchLinkOptions #123

Closed kehwar closed 1 year ago

kehwar commented 1 year ago

https://github.com/wobsoriano/trpc-nuxt/blob/4f6cbda2a2ffc7dda9af67a70c7f51eb010ae461/src/client/links.ts#L53

HttpBatchLinkOptions should not extend HTTPLinkOptions, the headers property have different typing

// HTTPBatchLinkOptions
((opts: { opList: NonEmptyArray<Operation> }) => HTTPHeaders | Promise<HTTPHeaders>)

HTTPBatchLinkOptions.ts

// HTTPLinkOptions
((opts: { op: Operation }) => HTTPHeaders | Promise<HTTPHeaders>)

httpLink.ts

Also, the maxURLLength property is already present in the native HttpBatchLinkOptions

wobsoriano commented 1 year ago

Hey, would you like to open a PR for this?