Skip to content

Commit

Permalink
feat: Use JSONResolver for Json scalar (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedElywa authored Aug 25, 2022
1 parent e464f2f commit e4143ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/scalars/Json.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GraphQLScalarType } from 'graphql'
import { JSONObjectResolver } from 'graphql-scalars'
import { JSONResolver } from 'graphql-scalars'
import { asNexusMethod } from 'nexus'

/**
Expand Down Expand Up @@ -32,7 +32,7 @@ import { asNexusMethod } from 'nexus'
*/
export const Json = asNexusMethod(
new GraphQLScalarType({
...JSONObjectResolver,
...JSONResolver,
// Override the default 'JsonObject' name with one that matches what Nexus Prisma expects.
name: 'Json',
}),
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/graphqlSchema/__snapshots__/json.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the \`da
scalar DateTime
\\"\\"\\"
The \`JSONObject\` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
The \`JSON\` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
\\"\\"\\"
scalar Json @specifiedBy(url: \\"http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf\\")
Expand Down

1 comment on commit e4143ac

@vercel
Copy link

@vercel vercel bot commented on e4143ac Aug 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.