Skip to content

Commit 086877e

Browse files
chore(deps): update dependencies valibot from v0.30.0 to v0.31.1 (#79)
* feat(deps): update dependencies valibot from v0.30.0 to v0.31.1 * fix type issue --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Dan Adajian <dadajian@expediagroup.com>
1 parent 6f3e468 commit 086877e

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

bun.lockb

471 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@graphql-codegen/plugin-helpers": "5.0.4",
2424
"@graphql-codegen/visitor-plugin-common": "5.2.0",
2525
"ts-deepmerge": "7.0.0",
26-
"valibot": "0.30.0"
26+
"valibot": "0.31.1"
2727
},
2828
"devDependencies": {
2929
"@graphql-codegen/cli": "5.0.2",

src/plugin.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ import {
2020
ParsedConfig,
2121
RawConfig,
2222
} from "@graphql-codegen/visitor-plugin-common";
23-
import { Input, safeParse } from "valibot";
23+
import { InferInput, safeParse } from "valibot";
2424
import { configSchema } from "./config/schema";
2525
import { buildConfigWithDefaults } from "./config/build-config-with-defaults";
2626
import { addDependentTypesToOnlyTypes } from "./config/add-dependent-types-to-only-types";
2727
import { visit } from "graphql";
2828

2929
export type GraphQLKotlinCodegenConfig = Partial<RawConfig & ParsedConfig> &
30-
Input<typeof configSchema>;
30+
InferInput<typeof configSchema>;
3131

3232
export const plugin: PluginFunction<GraphQLKotlinCodegenConfig> = (
3333
schema,
@@ -40,14 +40,7 @@ export const plugin: PluginFunction<GraphQLKotlinCodegenConfig> = (
4040
}
4141
const { issues } = safeParse(configSchema, config);
4242
if (issues) {
43-
throw new Error(
44-
issues
45-
.map(
46-
(issue) =>
47-
`${issue.path?.[0]?.key} must be ${issue.expected} (${issue.input} was provided)`,
48-
)
49-
.join("\n"),
50-
);
43+
throw new Error(issues.map((issue) => issue.message).join("\n"));
5144
}
5245

5346
const configWithDefaults = buildConfigWithDefaults(config, info.outputFile);

test/unit/should_throw_config_validation_error/codegen.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { GraphQLKotlinCodegenConfig } from "../../../src/plugin";
33
export default {
44
// @ts-expect-error - invalid config
55
onlyTypes: 2,
6-
expectedErrorMessage: "onlyTypes must be Array (2 was provided)",
6+
expectedErrorMessage: "Invalid type: Expected Array but received 2",
77
} satisfies GraphQLKotlinCodegenConfig;

0 commit comments

Comments
 (0)