Open krtooch opened 4 years ago
Can you add the definition of the enum, the converter might not see it as an enum.
// myModule/document.ts
export enum DocumentCategory {
AVATAR = 'avatar',
BONUS = 'bonus',
CERTIFICATE = 'certificate',
CURRICULUM_VITAE = 'curriculumVitae',
IBAN = 'IBAN',
}
Sorry this was lost in my notifications, I feel this is weird because I never see TS files in node_modules. Can you check if the import was added to the generated/index.ts
Just a note here. Is typegenAutoConfig
meant to appear in the type declarations for SchemaConfig
?
I get an error that this is not defined.
Hello,
My issue is very close to 335.
I d'like to use a Interface (from a node_module) to define a Nexus Enum, and use it as inputType for a resolver, to a fonction who accept
DocumentCategory
(same as 355 issue but with a interface from lib)import {DocumentCategory} from 'myModule/document'
// // enum DocumentCategory { // CV:'Curriculum', // IBAN: 'bank' // } //
const DocumentEnum = enumType({ name: "DocumentCategory", members: DocumentCategory });
export const schema = makeSchema({ types: [DocumentEnum], outputs: { schema: path.join(dirname, "my-schema.graphql"), typegen: path.join(dirname, "../../../src/generated/index.ts"), }, shouldGenerateArtifacts: true, typegenAutoConfig: { contextType: 'ctx.Context', debug :true, sources: [ { alias: "ctx", source: path.join(__dirname, "../../../src/Graphql/Frame/Context/index.ts"), }, { alias: "doc", source:'myModule/document', typeMatch: name => new RegExp(
(?:interface|type|class|enum)\\s+(${name}s?)\\W
, "g") } ] } });