graphql-type-decimal
Decimal scalar type for GraphQL.js primarily for currencies.
Ex: 21.01
Usage
This package exports a Decimal scalar GraphQL.js type:
;
GraphQL-tools
SDL withWhen using the SDL with GraphQL-tools, define GraphQLDecimal
as the resolver for the appropriate scalar type in your schema:
;; const typeDefs = `scalar Decimal type MyType { myField: Decimal} # ...`; const resolvers = Decimal: GraphQLDecimal; typeDefs resolvers ;
Dependency
This library uses bignumber.js
Related
This repository is inspired by graphql-type-datetime