@contember/graphql-utils
Advanced tools
Comparing version 1.2.0-alpha.2 to 1.2.0-alpha.3
import { GraphQLScalarType } from 'graphql'; | ||
export declare const DateTimeType: GraphQLScalarType; | ||
export declare const DateTimeType: GraphQLScalarType<Date | null, string | null>; | ||
//# sourceMappingURL=DateTimeType.d.ts.map |
@@ -12,2 +12,5 @@ "use strict"; | ||
parseValue(value) { | ||
if (typeof value !== 'string') { | ||
throw new graphql_1.GraphQLError('DateTime cannot represent a non string value'); | ||
} | ||
return new Date(value); | ||
@@ -14,0 +17,0 @@ }, |
import { GraphQLScalarType } from 'graphql'; | ||
export declare const JSONType: GraphQLScalarType; | ||
export declare const JSONType: GraphQLScalarType<unknown, unknown>; | ||
//# sourceMappingURL=JsonType.d.ts.map |
{ | ||
"name": "@contember/graphql-utils", | ||
"version": "1.2.0-alpha.2", | ||
"version": "1.2.0-alpha.3", | ||
"license": "Apache-2.0", | ||
@@ -11,4 +11,4 @@ "main": "dist/src/index.js", | ||
"devDependencies": { | ||
"@types/node": "^17.0.5", | ||
"graphql": "^15.4.0" | ||
"@types/node": "^16", | ||
"graphql": "^16.5.0" | ||
}, | ||
@@ -15,0 +15,0 @@ "peerDependencies": { |
@@ -1,4 +0,4 @@ | ||
import { GraphQLScalarType, Kind } from 'graphql' | ||
import { GraphQLError, GraphQLScalarType, Kind } from 'graphql' | ||
export const DateTimeType = new GraphQLScalarType({ | ||
export const DateTimeType = new GraphQLScalarType<Date | null, string | null>({ | ||
name: 'DateTime', | ||
@@ -10,2 +10,5 @@ description: 'DateTime custom scalar type', | ||
parseValue(value) { | ||
if (typeof value !== 'string') { | ||
throw new GraphQLError('DateTime cannot represent a non string value') | ||
} | ||
return new Date(value) | ||
@@ -12,0 +15,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
59525
216