Skip to content

Commit 780b0d8

Browse files
committed
fixed some code
1 parent 2417e2b commit 780b0d8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ import {
88
} from "@graphql-codegen/plugin-helpers";
99
import { GraphQLSchema } from "graphql";
1010

11-
export const plugin: PluginFunction<ValidationSchemaPluginConfig> = (
11+
export const plugin: PluginFunction<
12+
ValidationSchemaPluginConfig,
13+
Types.ComplexPluginOutput
14+
> = (
1215
schema: GraphQLSchema,
1316
_documents: Types.DocumentFile[],
1417
config: ValidationSchemaPluginConfig
15-
): Types.PluginOutput => {
18+
): Types.ComplexPluginOutput => {
1619
const { schema: _schema, ast } = transformSchemaAST(schema, config);
1720
const { buildImports, ...visitor } = YupSchemaVisitor(_schema, config);
1821

src/yup/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const YupSchemaVisitor = (
2929
if (config.importFrom && importTypes.length > 0) {
3030
return [
3131
importYup,
32-
`import { ${importTypes.join(", ")} } from "${config.importFrom}";`,
32+
`import { ${importTypes.join(", ")} } from '${config.importFrom}'`,
3333
];
3434
}
3535
return [importYup];
@@ -64,7 +64,7 @@ export const YupSchemaVisitor = (
6464
.withContent(
6565
`yup.mixed().oneOf([${node.values
6666
?.map(
67-
(enumOption) => `'${tsVisitor.convertName(enumOption.name)}'`
67+
(enumOption) => `'${enumOption.name.value}'`
6868
)
6969
.join(", ")}])`
7070
).string;

0 commit comments

Comments
 (0)