Skip to content

Correct isSpecifiedScalarType refinement, fix #2153 #2194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions tstypes/type/scalars.d.ts
Original file line number Diff line number Diff line change
@@ -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 const specifiedScalarTypes: ReadonlyArray<GraphQLScalarType>;
export type SpecifiedScalarType =
| typeof GraphQLInt
| typeof GraphQLFloat
| typeof GraphQLString
| typeof GraphQLBoolean
| typeof GraphQLID;

export function isSpecifiedScalarType(type: any): type is GraphQLScalarType;
export const specifiedScalarTypes: ReadonlyArray<SpecifiedScalarType>;

export function isSpecifiedScalarType(type: any): type is SpecifiedScalarType;