Skip to content

Commit 8f87a9f

Browse files
committed
Correct isSpecifiedScalarType refinement, fix #2153
1 parent ed0dfe8 commit 8f87a9f

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

tstypes/type/scalars.d.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
import { GraphQLScalarType } from './definition';
1+
import { GraphQLScalarType, isScalarType } from './definition';
22

3-
export const GraphQLInt: GraphQLScalarType;
4-
export const GraphQLFloat: GraphQLScalarType;
5-
export const GraphQLString: GraphQLScalarType;
6-
export const GraphQLBoolean: GraphQLScalarType;
7-
export const GraphQLID: GraphQLScalarType;
3+
export const GraphQLInt: GraphQLScalarType & { name: 'Int' };
4+
export const GraphQLFloat: GraphQLScalarType & { name: 'Float' };
5+
export const GraphQLString: GraphQLScalarType & { name: 'String' };
6+
export const GraphQLBoolean: GraphQLScalarType & { name: 'Boolean' };
7+
export const GraphQLID: GraphQLScalarType & { name: 'ID' };
8+
9+
export type SpecifiedScalarType =
10+
| typeof GraphQLInt
11+
| typeof GraphQLFloat
12+
| typeof GraphQLString
13+
| typeof GraphQLBoolean
14+
| typeof GraphQLID;
815

916
export const specifiedScalarTypes: ReadonlyArray<GraphQLScalarType>;
1017

11-
export function isSpecifiedScalarType(type: any): type is GraphQLScalarType;
18+
export function isSpecifiedScalarType(type: any): type is SpecifiedScalarType;

0 commit comments

Comments
 (0)