graphql-currency-scalars

GraphQL Scalars for formatting Currency

MIT 2 个版本
安装
npm install graphql-currency-scalars
yarn add graphql-currency-scalars
pnpm add graphql-currency-scalars
bun add graphql-currency-scalars
README

graphql-currency-scalars

Installation

yarn add graphql-currency-scalars

Usage

To use these scalars you'll need to add them in two places, your schema and your resolvers map.

In your schema:

scalar USCurrency

In your resolver map, first import them:

import {
  USCurrency
} from 'graphql-currency-scalars';

Then make sure they're in the root resolver map like this:

const myResolverMap = {
  USCurrency,

  Query: {},

  Mutation: {},
};

USCurrency

Format us cents into a fixed dollar amount.

1000 cents would become $10.00

版本列表
0.0.1 2019-03-29
0.0.0 2018-06-30