GraphQL is a wonderful new approach to application data and API layers that's gaining momentum. However, for all of GraphQL's greatness, it is missing a couple of things that we have (and you might) find very useful in defining your schemas. Namely GraphQL has a limited set of scalar types, and we have found there are some additional scalar types that are useful in being more precise in our schemas. Thankfully, those sharp GraphQL folks provided a simple way to add new custom scalar types if needed. That's what this package does. GraphQL Scalars is a library of custom GraphQL scalar types for creating precise type-safe GraphQL schemas. The GraphQL Specification has the Int, Float, String, Boolean and ID Scalar types by default. Those scalar types help you identify the data and validate it before transferring it between client and server. But you might need more specific scalars for your GraphQL application, to help you better describe and validate your app’s data.
Features
- Communicate to users of your schema exactly what they can expect or to at least reduce ambiguity in cases where that's possible
- Run-time type checking
- GraphQL helps to tighten up the contract between client and server
- The other benefit of using GraphQL scalar types is parsing and serializing while transferring data
- GraphQL Scalars is a library of custom GraphQL scalar types for creating precise type-safe GraphQL schemas
- The GraphQL Specification has the Int, Float, String, Boolean and ID Scalar types by default