From c24fefde346162878246056344d78ba762c0f3b1 Mon Sep 17 00:00:00 2001 From: jdecroock Date: Sat, 2 Nov 2024 09:16:46 +0100 Subject: [PATCH] Update ScalarType docs (#2567) --- website/pages/type.mdx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/website/pages/type.mdx b/website/pages/type.mdx index 0eb05d3302..eb1365c64a 100644 --- a/website/pages/type.mdx +++ b/website/pages/type.mdx @@ -188,16 +188,20 @@ const MyAppSchema = new GraphQLSchema({ ### GraphQLScalarType ```ts -class GraphQLScalarType { - constructor(config: GraphQLScalarTypeConfig); +class GraphQLScalarType { + constructor(config: GraphQLScalarTypeConfig); } -type GraphQLScalarTypeConfig = { +type GraphQLScalarTypeConfig = { name: string; description?: string; - serialize: (value: mixed) => InternalType; - parseValue?: (value: mixed) => InternalType; - parseLiteral?: (valueAST: Value) => InternalType; + specifiedByURL?: Maybe; + serialize: (outputValue: unknown) => ExternalType; + parseValue?: (inputValue: unknown) => InternalType; + parseLiteral?: ( + valueAST: Value, + variables?: Maybe>, + ) => InternalType; }; ```