Closed patrickdronk closed 10 months ago
Hello 👋
You can pass typescript-resolvers
config through presetConfig.typesPluginsConfig
option. I'll update the README to make it clearer
In your case, this should work:
import type { CodegenConfig } from "@graphql-codegen/cli";
import { preset } from "@eddeee888/gcg-typescript-resolver-files";
const config: CodegenConfig = {
schema: "**/schema.graphql",
generates: {
"src/schema": {
preset,
presetConfig: {
// Config you'd normally pass into `typescript` and `typescript-resolvers`'s config
// can be passed through typesPluginsConfig
typesPluginsConfig: {
federation: true,
},
},
},
},
};
export default config;
Doing this adds a _FieldSet
in Scalars
:
I haven't tried federation so please let me know what else's missing. Thanks! 🙏
I'm unsure if this is a bug, or just not in the preset. But currently, I'm trying to use the preset in combination with federation. But I'm not seeing any types being generated.
To Reproduce Use the following config:
generate types
Expected behavior I expect a referenceResolver type to be generated.