UNPKG

939 BJavaScriptView Raw
1Object.defineProperty(exports, "__esModule", { value: true });
2var graphql_1 = require("graphql");
3// FIXME: Replace with https://github.com/graphql/graphql-js/blob/master/src/type/scalars.js#L139
4exports.specifiedScalarTypes = [
5 graphql_1.GraphQLString,
6 graphql_1.GraphQLInt,
7 graphql_1.GraphQLFloat,
8 graphql_1.GraphQLBoolean,
9 graphql_1.GraphQLID,
10];
11function isSpecifiedScalarType(type) {
12 return (graphql_1.isNamedType(type) &&
13 // Would prefer to use specifiedScalarTypes.some(), however %checks needs
14 // a simple expression.
15 (type.name === graphql_1.GraphQLString.name ||
16 type.name === graphql_1.GraphQLInt.name ||
17 type.name === graphql_1.GraphQLFloat.name ||
18 type.name === graphql_1.GraphQLBoolean.name ||
19 type.name === graphql_1.GraphQLID.name));
20}
21exports.default = isSpecifiedScalarType;
22//# sourceMappingURL=isSpecifiedScalarType.js.map
\No newline at end of file