{"id":47957,"library":"graphql-tools-types","title":"GraphQL Tools Types","description":"Custom GraphQL scalar types for GraphQL-Tools, providing Void, Integer, Float, String, Date, UUID, and JSON scalars with validation options. Current stable version is 1.3.2. This package is in maintenance mode with infrequent releases. Key differentiators include built-in validation (min/max, regex, UUID format) and struct validation for JSON scalars. Unlike other GraphQL scalar libraries, it integrates directly with graphql-tools' makeExecutableSchema pattern.","status":"maintenance","version":"1.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/rse/graphql-tools-types","tags":["javascript","graphql","graphql-tools","custom","types","json","uuid"],"install":[{"cmd":"npm install graphql-tools-types","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-tools-types","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-tools-types","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used internally for UUID type generation and validation","package":"pure-uuid","optional":false},{"reason":"Peer dependency - provides GraphQL type system base classes","package":"graphql","optional":false}],"imports":[{"note":"Package exports a single default export. CommonJS require works but is not recommended for ESM projects.","wrong":"const GraphQLToolsTypes = require('graphql-tools-types')","symbol":"default","correct":"import GraphQLToolsTypes from 'graphql-tools-types'"},{"note":"Named exports are not available; you must access types via the default import object.","wrong":"import { Void } from 'graphql-tools-types'","symbol":"Void","correct":"GraphQLToolsTypes.Void({ name: 'MyVoid' })"},{"note":"Options object is required; name is mandatory for all types.","wrong":"GraphQLToolsTypes.UUID()","symbol":"UUID","correct":"GraphQLToolsTypes.UUID({ name: 'MyUUID' })"}],"quickstart":{"code":"import GraphQLToolsTypes from 'graphql-tools-types';\nimport * as GraphQLTools from 'graphql-tools';\nimport { graphql } from 'graphql';\n\nconst typeDefs = `\n  scalar MyDate\n  type Query {\n    today: MyDate\n  }\n`;\nconst resolvers = {\n  MyDate: GraphQLToolsTypes.Date({ name: 'MyDate' }),\n  Query: {\n    today: () => new Date().toISOString()\n  }\n};\nconst schema = GraphQLTools.makeExecutableSchema({ typeDefs, resolvers });\ngraphql(schema, '{ today }').then(result => console.log(result.data));","lang":"javascript","description":"Quick example showing how to use GraphQLToolsTypes.Date custom scalar with graphql-tools makeExecutableSchema."},"warnings":[{"fix":"Always pass an options object with at least the 'name' property.","message":"Options object is required for all type constructors; calling GraphQLToolsTypes.Void() without arguments will throw an error.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use a custom scalar with a validate function in graphql-tools instead of relying on regex.","message":"The 'regex' option for String type may not work as expected in newer versions of graphql; consider using custom scalars with validate functions instead.","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"Ensure 'pure-uuid' is listed in your package.json dependencies.","message":"The UUID type requires the 'pure-uuid' package to be installed as a dependency; if missing, runtime errors occur.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.3.2':29 'built':43 'built-in':42 'current':25 'custom':4,75 'date':17 'differenti':40 'direct':63 'float':15 'format':49 'graphql':1,5,10,58,66,71,73 'graphql-tool':9,65,72 'includ':41 'infrequ':37 'integ':14 'integr':62 'javascript':70 'json':20,54,77 'key':39 'librari':60 'mainten':34 'makeexecutableschema':68 'min/max':46 'mode':35 'option':24 'packag':31 'pattern':69 'provid':12 'regex':47 'releas':38 'scalar':6,21,55,59 'stabl':26 'string':16 'struct':51 'tool':2,11,67,74 'type':3,7,76 'unlik':56 'uuid':18,48,78 'valid':23,45,52 'version':27 'void':13","created_at":"2026-06-07T16:54:11.471602+00:00","updated_at":"2026-06-07T16:54:11.471602+00:00","problems":[{"fix":"Use default import: import GraphQLToolsTypes from 'graphql-tools-types';","cause":"Default import not used correctly, or package not installed.","error":"TypeError: Cannot read property 'Void' of undefined"},{"fix":"Ensure values passed to Date fields are ISO 8601 strings.","cause":"Date scalar expects ISO 8601 string; non-string values are rejected.","error":"GraphQLError: Expected type MyDate to be a string"},{"fix":"Pass an options object: { name: 'MyType' }","cause":"Called type constructor without options object.","error":"Error: Options object with 'name' property is required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/rse/graphql-tools-types","github":"https://github.com/rse/graphql-tools-types","docs":null,"changelog":null,"pypi":null,"npm":"graphql-tools-types","openapi_spec":null,"status_page":null,"smithery":null,"categories":["development"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}