Scalars


Built-In Scalars

The first step in our workflow is creating the uniform types that will serve as the building blocks for our api. These will serve two purposes: GraphQL schema generation, and compile time type safety for our resolvers. Let's begin with the built-in scalars. Uniform GraphQL ships with 5 built-in scalars:

Uniform GraphQLTypeScriptGraphQL
t.stringstringString!
t.floatnumberFloat!
t.intnumberInt!
t.idstring \| numberID!
t.booleanbooleanBoolean!

Custom Scalars

Use the t.scalar type factory to create custom scalars, which will carry both runtime and compile time type information just like any other type in our system.

Edit on GitHub