-
In the graphql codegen docs it makes use of plugins field. How to do the import thing when using @eddeee888/gcg-typescript-resolver-files? Without the import DeepPartial will end up as undefined in the generated types. |
Beta Was this translation helpful? Give feedback.
Answered by
eddeee888
Sep 11, 2023
Replies: 2 comments 1 reply
-
Hi @xoldyckk 👋
// codegen.ts
import type { CodegenConfig } from "@graphql-codegen/cli";
import { defineConfig } from "@eddeee888/gcg-typescript-resolver-files";
const config: CodegenConfig = {
schema: "**/schema.graphql",
generates: {
"src/schema": defineConfig({
typesPluginsConfig: { // using `defineConfig` means `typesPluginsConfig` is typed for `typescript` and `typescript-resolvers` options
defaultMapper: "DeepPartial<{T}>",
// and any other types plugins config
},
}),
},
};
export default config; Note that most but not all config options are being handled (due to being time-poor). I'm waiting for consumers usage/requests before implementing certain config 🙂. Let me know if you this worked for you |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's now official support in v0.7.0: https://github.com/eddeee888/graphql-code-generator-plugins/releases/tag/%40eddeee888%2Fgcg-typescript-resolver-files%400.7.0
Thanks for raising the issue and pinging me 🙌