Skip to content

Commit 3777e6d

Browse files
committed
Serialize JSON in the API as objects, not raw strings
1 parent 1865536 commit 3777e6d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/httptoolkit-server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ const buildResolvers = (
125125

126126
Json: new GraphQLScalarType({
127127
name: 'Json',
128-
description: 'A JSON entity, serialized as a simple JSON string',
129-
serialize: (value: any) => JSON.stringify(value),
130-
parseValue: (input: string): any => JSON.parse(input),
128+
description: 'A JSON entity, serialized as a raw object',
129+
serialize: (value: any) => value,
130+
parseValue: (input: string): any => input,
131131
parseLiteral: (): any => { throw new Error('JSON literals are not supported') }
132132
}),
133133

0 commit comments

Comments
 (0)