@graphity/types
TypeScript icon, indicating that this package has built-in type declarations

0.9.2 • Public • Published

Graphity - Types

Downloads Version License Typescript
dependencies Status

Installation

npm install @graphity/types --save

inputify

import { inputify } from '@graphity/types'

const GraphQLUser = new GraphQLObjectType({
  name: 'User',
  fields: {
    id: { type: GraphQLNonNull(GraphQLID) },
    name: { type: GraphQLNonNull(GraphQLString) },
    company: { type: new GraphQLObjectType({
      name: 'Company',
      fields: {
        id: { type: GraphQLNonNull(GraphQLID) },
        name: { type: GraphQLString },
      },
    }) },
  },
})

const InputGraphQLUser = inputify(GraphQLUser)

/*
input InputCompany {
  id: ID!
  name: String
}

input InputUser {
  id: ID!
  name: String!
  company: InputCompany
}
*/

const InputGraphQLUser = inputify(GraphQLUser, { disableRecursive: true })
/*
input InputUser {
  id: ID!
  name: String!
}
*/

Package Sidebar

Install

npm i @graphity/types

Weekly Downloads

1

Version

0.9.2

License

MIT

Unpacked Size

14.4 kB

Total Files

25

Last publish

Collaborators

  • wan2land