graphql-type-any

0.0.1 • Public • Published

GraphQL Any

An any type graphql-js.

Usage

$ yarn add graphql-type-any

Use it the same as any other scalar type, either input or output.

const Any = require('graphql-type-any');

const SomeType = new GraphQLObjectType({
  name: 'SomeType',
  fields: {
    crazyField: {
      type: Any,
      // this would throw an error with the GraphQLInt
      resolve: () => ({ goNuts: true, wtf: [1, 'two', [true, true, true]] }),
    },
  },
});

A word of warning. This stops schema validation (and all the type safety that comes along with it) in it's tracks. Use cautiously.

Readme

Keywords

Package Sidebar

Install

npm i graphql-type-any

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

3.78 kB

Total Files

6

Last publish

Collaborators

  • slightlytyler