From 037caf951623cf68ef45ec50e3534391eeb68ea0 Mon Sep 17 00:00:00 2001 From: Tim Griesser Date: Sun, 22 Sep 2019 23:09:31 -0400 Subject: [PATCH] Correct isSpecifiedScalarType refinement, fix #2153 --- tstypes/type/scalars.d.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tstypes/type/scalars.d.ts b/tstypes/type/scalars.d.ts index fe16fd5cad..ae2929c9ce 100644 --- a/tstypes/type/scalars.d.ts +++ b/tstypes/type/scalars.d.ts @@ -1,11 +1,18 @@ import { GraphQLScalarType } from './definition'; -export const GraphQLInt: GraphQLScalarType; -export const GraphQLFloat: GraphQLScalarType; -export const GraphQLString: GraphQLScalarType; -export const GraphQLBoolean: GraphQLScalarType; -export const GraphQLID: GraphQLScalarType; +export const GraphQLInt: GraphQLScalarType & { name: 'Int' }; +export const GraphQLFloat: GraphQLScalarType & { name: 'Float' }; +export const GraphQLString: GraphQLScalarType & { name: 'String' }; +export const GraphQLBoolean: GraphQLScalarType & { name: 'Boolean' }; +export const GraphQLID: GraphQLScalarType & { name: 'ID' }; + +export type SpecifiedScalarType = + | typeof GraphQLInt + | typeof GraphQLFloat + | typeof GraphQLString + | typeof GraphQLBoolean + | typeof GraphQLID; export const specifiedScalarTypes: ReadonlyArray; -export function isSpecifiedScalarType(type: any): type is GraphQLScalarType; +export function isSpecifiedScalarType(type: any): type is SpecifiedScalarType;