# @anchan828/gen-graphql-order-schema

> Auto generation for order type

Latest version **0.7.68** (published 2023-04-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @anchan828/gen-graphql-order-schema
pnpm add @anchan828/gen-graphql-order-schema
yarn add @anchan828/gen-graphql-order-schema
bun add @anchan828/gen-graphql-order-schema
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.68 |
| Published | 2023-04-16 |
| First published | 2019-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 29.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | anchan828 |
| Maintainers | anchan828 |

## Links

- npm: https://www.npmjs.com/package/@anchan828/gen-graphql-order-schema
- Repository: https://github.com/anchan828/gen-graphql-schema
- Homepage: https://github.com/anchan828/gen-graphql-schema/tree/master/packages/order-schema#readme
- Issues: https://github.com/anchan828/gen-graphql-schema/issues
- npm.io page: https://npm.io/package/@anchan828/gen-graphql-order-schema

## Dependencies (5)

- [deepmerge](https://npm.io/package/deepmerge.md) ^4.3.1
- [object-path](https://npm.io/package/object-path.md) ^0.11.8
- [natural-orderby](https://npm.io/package/natural-orderby.md) ^3.0.1
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@anchan828/gen-graphql-schema-common](https://npm.io/package/@anchan828/gen-graphql-schema-common.md) ^0.7.68

## Recent versions

- 0.7.68 (latest) — 2023-04-16
- 0.7.67 — 2023-04-09
- 0.7.66 — 2023-04-02
- 0.7.65 — 2023-03-26
- 0.7.64 — 2023-03-19
- 0.7.63 — 2023-03-12
- 0.7.62 — 2023-03-05
- 0.7.61 — 2023-02-26
- 0.7.60 — 2023-02-19
- 0.7.59 — 2023-02-12
- 0.7.58 — 2023-02-05
- 0.7.57 — 2023-01-29
- 0.7.56 — 2023-01-22
- 0.7.55 — 2023-01-15
- 0.7.54 — 2023-01-08
- … 151 more at https://npm.io/package/@anchan828/gen-graphql-order-schema/versions

## README

# @anchan828/gen-graphql-order-schema

## Description

Generate order schema by directive

## Quick Start

```ts
import { genOrderTypes } from "@anchan828/gen-graphql-order-schema";
import { buildASTSchema, printSchema } from "graphql";

const schema = `

type Test {
  id: ID
}

type Query {
  tests: [Test] @orderBy
}

`;

printSchema(buildASTSchema(genOrderTypes(schema)));
//=>  enum OrderDirection {
//      ASC
//      DESC
//    }
//
//    type Query {
//      tests(orderBy: [TestOrder]): [Test]
//    }
//
//    type Test {
//      id: ID
//    }
//
//    type TestOrder {
//      sort: TestSort
//      direction: OrderDirection
//    }
//
//    enum TestSort {
//      ID
//    }
```

## Options

TODO

## Supoprted Types

For now, supported types are **Basic Types** (String, Int, Float, Boolean, ID), and Enum

## License

[MIT](LICENSE).

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