-
When using a library such as const JsonType = builder.scalarType('GraphQLJSON', GraphQLJSON); which resulted to error below: Seems like the type needs to change to: description?: string | null;
extensions?: Readonly<Record<string, unknown>> | null; Narrowed it down to this: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
There are 2 methods: scalarType let's you define your own scalars by implementing methods directly. addScalarType let's you add existing scalar definitions. |
Beta Was this translation helpful? Give feedback.
-
Awesome, thank you @hayes! |
Beta Was this translation helpful? Give feedback.
-
Trying this with import { GraphQLDateTime } from 'graphql-iso-date'
export const builder = new SchemaBuilder<{
Context: IContext;
PrismaTypes: PrismaTypes
Scalars: {
DateTime: {
Input: Date
Output: Date
}
}
}>({
plugins: [PrismaPlugin],
prisma: {
client: prisma,
},
})
builder.addScalarType("DateTime", GraphQLDateTime, {}) and I get the following error
This must be a common scalar type to add, any ideas what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
There are 2 methods:
scalarType let's you define your own scalars by implementing methods directly.
addScalarType let's you add existing scalar definitions.
https://giraphql.com/guide/scalars#adding-graphql-scalars