Skip to content

Commit c24fefd

Browse files
committed
Update ScalarType docs (#2567)
1 parent 80750da commit c24fefd

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

website/pages/type.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,20 @@ const MyAppSchema = new GraphQLSchema({
188188
### GraphQLScalarType
189189

190190
```ts
191-
class GraphQLScalarType<InternalType> {
192-
constructor(config: GraphQLScalarTypeConfig<InternalType>);
191+
class GraphQLScalarType<InternalType, ExternalType> {
192+
constructor(config: GraphQLScalarTypeConfig<InternalType, ExternalType>);
193193
}
194194

195-
type GraphQLScalarTypeConfig<InternalType> = {
195+
type GraphQLScalarTypeConfig<InternalType, ExternalType> = {
196196
name: string;
197197
description?: string;
198-
serialize: (value: mixed) => InternalType;
199-
parseValue?: (value: mixed) => InternalType;
200-
parseLiteral?: (valueAST: Value) => InternalType;
198+
specifiedByURL?: Maybe<string>;
199+
serialize: (outputValue: unknown) => ExternalType;
200+
parseValue?: (inputValue: unknown) => InternalType;
201+
parseLiteral?: (
202+
valueAST: Value,
203+
variables?: Maybe<Record<string, unknown>>,
204+
) => InternalType;
201205
};
202206
```
203207

0 commit comments

Comments
 (0)