# @crawlo/graphql

> Some tooling for GraphQL

Latest version **1.0.39** (published 2021-10-19) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.39 |
| Published | 2021-10-19 |
| First published | 2021-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 25 |
| Unpacked size | 46.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Crawlo |
| Maintainers | crawlo |
| Keywords | graphql |

## Links

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

## Dependencies (25)

- [case](https://npm.io/package/case.md) ^1.5.5
- [y18n](https://npm.io/package/y18n.md) >=3.2.2
- [merge](https://npm.io/package/merge.md) >=2.1.1
- [lodash](https://npm.io/package/lodash.md) >=4.17.21
- [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
- [js-yaml](https://npm.io/package/js-yaml.md) >=3.13.1
- [winston](https://npm.io/package/winston.md) ^3.3.3
- [set-value](https://npm.io/package/set-value.md) >=4.0.1
- [url-parse](https://npm.io/package/url-parse.md) >=1.5.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
- [glob-parent](https://npm.io/package/glob-parent.md) >=5.1.2
- [include-all](https://npm.io/package/include-all.md) ^4.0.3
- [@crawlo/entity](https://npm.io/package/@crawlo/entity.md) ^1.1.26
- [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
- [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

- 1.0.39 (latest) — 2021-10-19
- 1.0.38 — 2021-10-19
- 1.0.37 — 2021-10-18
- 1.0.36 — 2021-10-18
- 1.0.35 — 2021-10-18
- 1.0.34 — 2021-10-18
- 1.0.33 — 2021-10-18
- 1.0.32 — 2021-10-18
- 1.0.31 — 2021-10-18
- 1.0.30 — 2021-10-18
- 1.0.29 — 2021-10-18
- 1.0.28 — 2021-10-16
- 1.0.27 — 2021-10-16
- 1.0.26 — 2021-10-16
- 1.0.25 — 2021-10-16
- … 18 more at https://npm.io/package/@crawlo/graphql/versions

## README

# @crawlo/graphql

let's consider this type

```js
import { GraphQLObjectType, GraphQLString, GraphQLID } from "@crawlo/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 "@crawlo/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 "@crawlo/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 "@crawlo/graphql";

const Type = new GraphQLObjectType({
  name: "ScalarExample",
  fields: {
    id: {
      type: GraphQLID,
    },
    type: {
      type: GraphQLString,
    },
    data: {
      type: Scalar,
    },
  },
});
```

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