mercurius-js / mercurius-typescript

TypeScript usage examples and "mercurius-codegen" for Mercurius

Home Page:https://mercurius.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Way to add typings for custom scalars?

SkeLLLa opened this issue · comments

commented

Hi. Is there any way or "recommended" way to add typings for custom scalars? For example, if I define new scalar UUID with resolver that verifies that it's really UUID.
But in generated.ts those new scalars are typed as any so I'm searching the best way to pass there proper typings.

codegenMercurius(app, {
  targetPath: './src/graphql/generated.ts',
  codegenConfig: {
   scalars: {
      UUID: "string"
   }
  }
}).catch(console.error)
commented

Thanks, looks like I've missed that part of doc.