# @oudyworks/graphql

> Some tooling for GraphQL

Latest version **2.0.6** (published 2019-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @oudyworks/graphql
pnpm add @oudyworks/graphql
yarn add @oudyworks/graphql
bun add @oudyworks/graphql
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.6 |
| Published | 2019-02-02 |
| First published | 2018-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 19 |
| Unpacked size | 45.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ayoub Oudmane |
| Maintainers | oudmane |
| Keywords | graphql |

## Links

- npm: https://www.npmjs.com/package/@oudyworks/graphql
- Repository: https://github.com/OudyWorks/graphql
- Homepage: https://github.com/OudyWorks/graphql#readme
- Issues: https://github.com/OudyWorks/graphql/issues
- npm.io page: https://npm.io/package/@oudyworks/graphql

## Dependencies (19)

- [ws](https://npm.io/package/ws.md) ^5.2.2
- [case](https://npm.io/package/case.md) ^1.5.5
- [plural](https://npm.io/package/plural.md) ^1.1.0
- [express](https://npm.io/package/express.md) ^4.16.3
- [graphql](https://npm.io/package/graphql.md) ^0.13.2
- [body-parser](https://npm.io/package/body-parser.md) ^1.18.3
- [compression](https://npm.io/package/compression.md) ^1.7.3
- [flatten-obj](https://npm.io/package/flatten-obj.md) ^3.1.1
- [include-all](https://npm.io/package/include-all.md) ^4.0.3
- [graphql-errors](https://npm.io/package/graphql-errors.md) ^2.1.0
- [express-graphql](https://npm.io/package/express-graphql.md) ^0.6.12
- [deep-object-diff](https://npm.io/package/deep-object-diff.md) ^1.1.0
- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) ^4.5.0
- [@oudyworks/entity](https://npm.io/package/@oudyworks/entity.md) ^1.1.24
- [@oudyworks/drivers](https://npm.io/package/@oudyworks/drivers.md) ^1.0.33
- [apollo-server-express](https://npm.io/package/apollo-server-express.md) ^1.4.0
- [graphql-subscriptions](https://npm.io/package/graphql-subscriptions.md) ^0.5.8
- [recursive-readdir-sync](https://npm.io/package/recursive-readdir-sync.md) ^1.0.6
- [subscriptions-transport-ws](https://npm.io/package/subscriptions-transport-ws.md) ^0.9.15

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 2.0.6 (latest) — 2019-02-02
- 2.0.5 — 2018-09-29
- 2.0.4 — 2018-09-02
- 2.0.3 — 2018-08-23
- 2.0.2 — 2018-08-23
- 2.0.2-0 — 2018-08-23
- 1.0.73 — 2018-08-15
- 1.0.72 — 2018-08-12
- 1.0.71 — 2018-08-12
- 1.0.70 — 2018-08-09
- 1.0.69 — 2018-08-08
- 1.0.68 — 2018-06-18
- 1.0.67 — 2018-06-17
- 1.0.66 — 2018-06-17
- 1.0.65 — 2018-06-17
- … 64 more at https://npm.io/package/@oudyworks/graphql/versions

## README

# @oudyworks/graphql

let's consider this type

```js
import {
  GraphQLObjectType,
  GraphQLString,
  GraphQLID
} from '@oudyworks/graphql'

const Type = new GraphQLObjectType({
    name: 'Example',
    fields: {
        id: {
            type: GraphQLID
        },
        name: {
            type: GraphQLString
        }
    }
})
```

## getConfig(Type)
getConfig(Type) will return the fields used of **Type**, in graphql fields could be an object or a function, getConfig(Type) returns the object eitherwa

```js
import {
  getConfig
} from '@oudyworks/graphql'

let fields = getConfig(Type)
// fields = {
//     id: {
//         type: GraphQLID
//     },
//     name: {
//         type: GraphQLString
//     }
// }
```

## getInputObjectType(Type)
getInputObjectType(Type) will create a GraphQLInputObjectType with the same fields of **Type**

```js
import {
  getInputObjectType
} from '@oudyworks/graphql'

let inputType = getInputObjectType(Type)
// inputType = new GraphQLInputObjectType({
//     name: 'ExampleInput',
//     fields: {
//         id: {
//             type: GraphQLID
//         },
//         name: {
//             type: GraphQLString
//         }
//     }
// })
```

## getErrorType(Type)
get a type with the same fields of Type for Errors

## Scalar
Scalar is a scalar type for grahql, it can be a String, Boolean, Integer, Float, Object or Array

```js
import {
  GraphQLObjectType,
  GraphQLString,
  GraphQLID,
  Scalar
} from '@oudyworks/graphql'

const Type = new GraphQLObjectType({
    name: 'ScalarExample',
    fields: {
        id: {
            type: GraphQLID
        },
        type: {
            type: GraphQLString
        },
        data: {
            type: Scalar
        }
    }
})
```

---
_Source: https://npm.io/package/@oudyworks/graphql · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
