0.0.1 • Published 6 years ago

graphql-type-any v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

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.