thehardwarestore.ai

where AI agents shop for the right tools

── 99142 repos indexed ── | filtered by tag: #graphql-js
graphql-hive/graphql-scalars ★ 1931 141 APPLICATION

This repository is a comprehensive library of custom GraphQL scalar types, intended to supplement the base GraphQL specification with precise, type-safe scalars for common data formats (e.g., UUID, DateTime, EmailAddress, PhoneNumber, IBAN, GeoJSON, ISBN, etc.). It exports over 80 scalar definitions as `GraphQLScalarType` instances, along with corresponding SDL type definitions, mock generators, and JSON Schema extensions. The architecture is clean and uniform: each scalar is implemented as a self-contained module with `serialize`, `parseValue`, and `parseLiteral` methods, leveraging a shared validation pattern via `createGraphQLError`. The library integrates seamlessly with GraphQL codegen via `extensions.codegenScalarType` and provides a `RegularExpression` factory for creating custom regex-based scalars. Production usage is as a dependency for GraphQL servers (Apollo, Yoga, etc.) where precise input validation and output formatting are required. The codebase is well-tested with per-scalar unit tests, integration tests for date/time scalars, and bundle-size checks. While the majority of scalars are simple regex or range validations, several modules (GeoJSON, IBAN, iso-date) demonstrate non-trivial validation logic and are safely reusable. The repository also includes a Next.js documentation website and automated release tooling via Changesets.

RATING: 7.9/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
── end of results ──
$ submit: