From 47d72d71a366768db27c493c4c22870b03885a0e Mon Sep 17 00:00:00 2001 From: mx-bernhard <30629795+mx-bernhard@users.noreply.github.com> Date: Mon, 22 Jul 2024 23:16:55 +0200 Subject: [PATCH] Update custom-scalars.mdx (#7880) `value` should be of type `unknown` instead of `number` with graphql@16.8.1: ```log Type '(value: number) => number' is not assignable to type 'GraphQLScalarValueParser'. Types of parameters 'value' and 'inputValue' are incompatible. Type 'unknown' is not assignable to type 'number'.ts(2322) definition.d.ts(365, 3): The expected type comes from property 'parseValue' which is declared here on type 'Readonly>' ``` --- docs/source/schema/custom-scalars.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/schema/custom-scalars.mdx b/docs/source/schema/custom-scalars.mdx index 85d228035e8..5c6ebeedd3a 100644 --- a/docs/source/schema/custom-scalars.mdx +++ b/docs/source/schema/custom-scalars.mdx @@ -174,7 +174,7 @@ const typeDefs = `#graphql `; // Validation function for checking "oddness" -function oddValue(value: number) { +function oddValue(value: unknown) { if (typeof value === 'number' && Number.isInteger(value) && value % 2 !== 0) { return value; }