@anchan828/gen-order-schema
v0.1.13
Published
Auto generation for order type
Downloads
6
Readme
@anchan828/gen-order-schema
Description
Generate order enum schema by directive
Quick Start
import { genOrderTypes } from "@anchan828/gen-order-schema"
const schema = `
type Test {
id: ID
}
type Query {
tests: [Test] @orderBy
}
`;
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.