@coex/graphql-vercajk
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -32,5 +32,5 @@ export type GraphqlVercajkOptions = { | ||
export interface GraphqlVercajkFieldInfo { | ||
[key: string]: GraphqlVercajkFieldName; | ||
[key: string]: GraphqlVercajkField; | ||
} | ||
export interface GraphqlVercajkFieldName { | ||
export interface GraphqlVercajkField { | ||
[fieldName: string]: GraphqlVercajkFieldContent; | ||
@@ -40,3 +40,3 @@ } | ||
constraints: GraphqlVercajkConstraints | null; | ||
children: GraphqlVercajkFieldName | null; | ||
children: GraphqlVercajkField | null; | ||
required: boolean; | ||
@@ -43,0 +43,0 @@ order: number; |
import { ConstDirectiveNode } from "graphql"; | ||
import { GraphqlVercajkConstraints, GraphqlVercajkFieldInfo, GraphqlVercajkOptions } from "../graphql-vercajk.dto.js"; | ||
export declare const assembleInput: (schema: string, config: GraphqlVercajkOptions) => GraphqlVercajkFieldInfo; | ||
export declare const extractDirectiveFields: (directive: ConstDirectiveNode | undefined) => GraphqlVercajkConstraints; | ||
export declare const extractDirectiveFields: (directive: ConstDirectiveNode | undefined) => GraphqlVercajkConstraints | null; | ||
export declare const getNamedInputType: (type: any) => string | null; |
@@ -44,3 +44,3 @@ import { parse, visit } from "graphql"; | ||
}); | ||
return constraints || {}; | ||
return Object.keys(constraints).length !== 0 ? constraints : null; | ||
}; | ||
@@ -47,0 +47,0 @@ export const getNamedInputType = (type) => { |
#!/usr/bin/env node | ||
import { assembleInput } from './helpers/parser.js'; | ||
declare const generate: () => Promise<void>; | ||
export type { GraphqlVercajkConstraints, GraphqlVercajkFieldContent, GraphqlVercajkFieldInfo, GraphqlVercajkFieldName } from './graphql-vercajk.dto.js'; | ||
export type { GraphqlVercajkConstraints, GraphqlVercajkField, GraphqlVercajkFieldContent, GraphqlVercajkFieldInfo } from './graphql-vercajk.dto.js'; | ||
export { assembleInput, generate }; |
{ | ||
"name": "@coex/graphql-vercajk", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Collection of graphql tools", | ||
@@ -5,0 +5,0 @@ "bin": { |
11555