graphql-tools-type-flat-object

2.0.2 • Public • Published

graphql-tools-type-flat-object

Build Status Coverage Status

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

Dependents (0)

Package Sidebar

Install

npm i graphql-tools-type-flat-object

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

15.6 kB

Total Files

5

Last publish

Collaborators

  • up9cloud