Skip to content

Commit

Permalink
Update ScalarType docs (#2567)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Nov 2, 2024
1 parent 80750da commit c24fefd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions website/pages/type.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,20 @@ const MyAppSchema = new GraphQLSchema({
### GraphQLScalarType

```ts
class GraphQLScalarType<InternalType> {
constructor(config: GraphQLScalarTypeConfig<InternalType>);
class GraphQLScalarType<InternalType, ExternalType> {
constructor(config: GraphQLScalarTypeConfig<InternalType, ExternalType>);
}

type GraphQLScalarTypeConfig<InternalType> = {
type GraphQLScalarTypeConfig<InternalType, ExternalType> = {
name: string;
description?: string;
serialize: (value: mixed) => InternalType;
parseValue?: (value: mixed) => InternalType;
parseLiteral?: (valueAST: Value) => InternalType;
specifiedByURL?: Maybe<string>;
serialize: (outputValue: unknown) => ExternalType;
parseValue?: (inputValue: unknown) => InternalType;
parseLiteral?: (
valueAST: Value,
variables?: Maybe<Record<string, unknown>>,
) => InternalType;
};
```

Expand Down

0 comments on commit c24fefd

Please sign in to comment.