graphql-anyscalar

1.1.2 • Public • Published

graphql-anyscalar

graphql-anyscalar provides an AnyScalar GraphQL type. This type can be used to handle any GraphQL scalar type (except GraphQLID), resolving by examining the input value.

Installation

yarn add graphql-anyscalar

Usage

const {
  AnyScalar,
} = require('graphql-anyscalar');
const {
  GraphQLObjectType,
} = require('graphql');
 
const someObject = new GraphQLObjectType({
  name: 'someObject',
  fields: {
    // Use AnyScalar like you would use some other scalar type like GraphQLString.
    someScalar: { type: AnyScalar }
  },
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.2
    114
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.2
    114
  • 1.1.1
    0
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i graphql-anyscalar

Weekly Downloads

114

Version

1.1.2

License

MIT

Last publish

Collaborators

  • chasingmaxwell