@graphity/types
v0.9.2
Published
GraphQL scalar types and helpers.
Downloads
2
Readme
Graphity - Types
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!
}
*/