graphql-tools-type-flat-object
v2.0.2
Published
FlatObject scalar type for graphql-tools
Downloads
13
Maintainers
Readme
graphql-tools-type-flat-object
FlatObject scalar type for graphql-tools
Usage
import { makeExecutableSchema } from 'graphql-tools'
import FlatObject from 'graphql-tools-type-flat-object'
// by default, the scalar type is nullable and won't return errors
// so suggest using FlatObject! (non-null) type.
let typeDefs = [`
scalar FlatObject
type Query {
value(arg: FlatObject!): FlatObject
}`
]
let resolvers = {
FlatObject,
Query: {
value: (root, { arg }) => arg
}
}
let schema = makeExecutableSchema({ typeDefs, resolvers })
export default schema
Minimum amount of module files
$ tree ./node_modules/graphql-tools-type-flat-object
./node_modules/graphql-tools-type-flat-object
├── README.md
├── dist
│ └── index.js
└── package.json
1 directory, 3 files