GraphQL Mesh supports TypeScript, and you can easily use it to generate typings for the fetched data, or for you custom resolvers that specific under
Type safety for custom resolvers
GraphQL Mesh allow API handler packages to provide TypeScript typings in order to have types support in your code.
In order to use the TypeScript support, use the CLI to generate typings file based on your unified GraphQL schema:
Now, you can import
Resolvers interface from the generated file, and use it as the type for your custom resolvers. It will make sure that your parent value, arguments, context type and return value are fully compatible with the implementation. It will also provide fully typed SDK from the context:
And make sure you have
require section set in your config file (to allow GraphQL Mesh to compile TypeScript files):
Type safety for fetched data
See Mesh as SDK section.