https://github.com/up9cloud/graphql-tools-type-flat-object
https://github.com/up9cloud/graphql-tools-type-flat-object
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/up9cloud/graphql-tools-type-flat-object
- Owner: up9cloud
- Created: 2018-01-27T07:50:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T11:19:41.000Z (almost 5 years ago)
- Last Synced: 2025-04-05T21:14:58.462Z (about 1 year ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# graphql-tools-type-flat-object
[](https://travis-ci.org/up9cloud/graphql-tools-type-flat-object)
[](https://coveralls.io/github/up9cloud/graphql-tools-type-flat-object?branch=master)
FlatObject scalar type for [graphql-tools](https://github.com/apollographql/graphql-tools)
## Usage
```js
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
```console
$ 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
```