graphile-build
Advanced tools
Comparing version 5.0.0-beta.17 to 5.0.0-beta.18
# graphile-build | ||
## 5.0.0-beta.18 | ||
### Patch Changes | ||
- [#2056](https://github.com/graphile/crystal/pull/2056) | ||
[`1842af661`](https://github.com/graphile/crystal/commit/1842af661950d5f962b65f6362a45a3b9c8f15e8) | ||
Thanks [@benjie](https://github.com/benjie)! - Improve exporting of resource | ||
options (neater export code) | ||
- Updated dependencies | ||
[[`bd5a908a4`](https://github.com/graphile/crystal/commit/bd5a908a4d04310f90dfb46ad87398ffa993af3b)]: | ||
- grafast@0.1.1-beta.8 | ||
## 5.0.0-beta.17 | ||
@@ -4,0 +17,0 @@ |
@@ -162,2 +162,3 @@ import type { BaseGraphQLArguments, ExecutableStep, GrafastArgumentConfig, GrafastFieldConfig, GrafastFieldConfigArgumentMap, GrafastInputFieldConfig, GrafastInputFieldConfigMap, OutputPlanForType } from "grafast"; | ||
EXPORTABLE<T, TScope extends any[]>(factory: (...args: TScope) => T, args: [...TScope], nameHint?: string): T; | ||
EXPORTABLE_OBJECT_CLONE<T extends object>(obj: T): T; | ||
exportNameHint(obj: any, nameHint: string): void; | ||
@@ -164,0 +165,0 @@ /** |
@@ -5,3 +5,3 @@ import "./global.js"; | ||
import SchemaBuilder from "./SchemaBuilder.js"; | ||
export { camelCase, constantCase, constantCaseAll, EXPORTABLE, formatInsideUnderscores, gatherConfig, pluralize, singularize, upperCamelCase, upperFirst, } from "./utils.js"; | ||
export { camelCase, constantCase, constantCaseAll, EXPORTABLE, EXPORTABLE_OBJECT_CLONE, formatInsideUnderscores, gatherConfig, pluralize, singularize, upperCamelCase, upperFirst, } from "./utils.js"; | ||
import type { GrafastArgumentConfig, GrafastFieldConfig, GrafastFieldConfigArgumentMap, PromiseOrDirect } from "grafast"; | ||
@@ -8,0 +8,0 @@ import type { GraphQLArgumentConfig, GraphQLEnumTypeConfig, GraphQLEnumValueConfig, GraphQLEnumValueConfigMap, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLScalarTypeConfig, GraphQLSchema, GraphQLSchemaConfig } from "grafast/graphql"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = exports.watchSchema = exports.makeSchema = exports.defaultPreset = exports.TrimEmptyDescriptionsPlugin = exports.SwallowErrorsPlugin = exports.SubscriptionPlugin = exports.StreamDeferPlugin = exports.RegisterQueryNodePlugin = exports.QueryQueryPlugin = exports.QueryPlugin = exports.PageInfoStartEndCursorPlugin = exports.NodePlugin = exports.NodeIdCodecPipeStringPlugin = exports.NodeIdCodecBase64JSONPlugin = exports.NodeAccessorPlugin = exports.MutationPlugin = exports.MutationPayloadQueryPlugin = exports.CursorTypePlugin = exports.CommonTypesPlugin = exports.ClientMutationIdDescriptionPlugin = exports.BuiltinScalarConnectionsPlugin = exports.AddNodeInterfaceToSuitableTypesPlugin = exports.buildSchema = exports.getBuilder = exports.watchGather = exports.gather = exports.buildInflection = exports.SchemaBuilder = exports.upperFirst = exports.upperCamelCase = exports.singularize = exports.pluralize = exports.gatherConfig = exports.formatInsideUnderscores = exports.EXPORTABLE = exports.constantCaseAll = exports.constantCase = exports.camelCase = void 0; | ||
exports.version = exports.watchSchema = exports.makeSchema = exports.defaultPreset = exports.TrimEmptyDescriptionsPlugin = exports.SwallowErrorsPlugin = exports.SubscriptionPlugin = exports.StreamDeferPlugin = exports.RegisterQueryNodePlugin = exports.QueryQueryPlugin = exports.QueryPlugin = exports.PageInfoStartEndCursorPlugin = exports.NodePlugin = exports.NodeIdCodecPipeStringPlugin = exports.NodeIdCodecBase64JSONPlugin = exports.NodeAccessorPlugin = exports.MutationPlugin = exports.MutationPayloadQueryPlugin = exports.CursorTypePlugin = exports.CommonTypesPlugin = exports.ClientMutationIdDescriptionPlugin = exports.BuiltinScalarConnectionsPlugin = exports.AddNodeInterfaceToSuitableTypesPlugin = exports.buildSchema = exports.getBuilder = exports.watchGather = exports.gather = exports.buildInflection = exports.SchemaBuilder = exports.upperFirst = exports.upperCamelCase = exports.singularize = exports.pluralize = exports.gatherConfig = exports.formatInsideUnderscores = exports.EXPORTABLE_OBJECT_CLONE = exports.EXPORTABLE = exports.constantCaseAll = exports.constantCase = exports.camelCase = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -39,2 +39,3 @@ require("./global.js"); | ||
Object.defineProperty(exports, "EXPORTABLE", { enumerable: true, get: function () { return utils_js_1.EXPORTABLE; } }); | ||
Object.defineProperty(exports, "EXPORTABLE_OBJECT_CLONE", { enumerable: true, get: function () { return utils_js_1.EXPORTABLE_OBJECT_CLONE; } }); | ||
Object.defineProperty(exports, "formatInsideUnderscores", { enumerable: true, get: function () { return utils_js_1.formatInsideUnderscores; } }); | ||
@@ -41,0 +42,0 @@ Object.defineProperty(exports, "gatherConfig", { enumerable: true, get: function () { return utils_js_1.gatherConfig; } }); |
@@ -84,2 +84,3 @@ "use strict"; | ||
exportNameHint: utils_js_1.exportNameHint, | ||
EXPORTABLE_OBJECT_CLONE: utils_js_1.EXPORTABLE_OBJECT_CLONE, | ||
grafast, | ||
@@ -86,0 +87,0 @@ graphql, |
import type { GraphQLNamedType, GraphQLScalarTypeConfig } from "grafast/graphql"; | ||
import { GraphQLObjectType } from "grafast/graphql"; | ||
export declare function EXPORTABLE<T, TScope extends any[]>(factory: (...args: TScope) => T, args: [...TScope], nameHint?: string): T; | ||
export declare function EXPORTABLE_OBJECT_CLONE<T extends object>(obj: T): T; | ||
export declare function exportNameHint(obj: any, nameHint: string): void; | ||
@@ -5,0 +6,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.gatherConfig = exports.stringTypeSpec = exports.wrapDescription = exports.isValidObjectType = exports.singularize = exports.pluralize = exports.upperCamelCase = exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.bindAll = exports.exportNameHint = exports.EXPORTABLE = void 0; | ||
exports.gatherConfig = exports.stringTypeSpec = exports.wrapDescription = exports.isValidObjectType = exports.singularize = exports.pluralize = exports.upperCamelCase = exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.bindAll = exports.exportNameHint = exports.EXPORTABLE_OBJECT_CLONE = exports.EXPORTABLE = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -11,2 +11,3 @@ const grafast_1 = require("grafast"); | ||
const pluralize_1 = tslib_1.__importDefault(require("pluralize")); | ||
const tamedevil_1 = tslib_1.__importDefault(require("tamedevil")); | ||
function EXPORTABLE(factory, args, nameHint) { | ||
@@ -25,2 +26,15 @@ const fn = factory(...args); | ||
exports.EXPORTABLE = EXPORTABLE; | ||
function EXPORTABLE_OBJECT_CLONE(obj) { | ||
if (Object.getPrototypeOf(obj) === Object.prototype) { | ||
const keys = Object.keys(obj); | ||
const values = Object.values(obj); | ||
const fn = tamedevil_1.default.eval `return (${tamedevil_1.default.join(keys.map((_key, i) => tamedevil_1.default.identifier(`key${i}`)), ", ")}) => ({${tamedevil_1.default.indent(tamedevil_1.default.join(keys.map((key, i) => (0, tamedevil_1.default) `${tamedevil_1.default.safeKeyOrThrow(key)}: ${tamedevil_1.default.identifier(`key${i}`)}`), ",\n"))}});`; | ||
// eslint-disable-next-line graphile-export/exhaustive-deps | ||
return EXPORTABLE(fn, values); | ||
} | ||
else { | ||
throw new Error("EXPORTABLE_OBJECT_CLONE can currently only be used with POJOs."); | ||
} | ||
} | ||
exports.EXPORTABLE_OBJECT_CLONE = EXPORTABLE_OBJECT_CLONE; | ||
function exportNameHint(obj, nameHint) { | ||
@@ -27,0 +41,0 @@ if ((typeof obj === "object" && obj != null) || typeof obj === "function") { |
@@ -1,2 +0,2 @@ | ||
export declare const version = "5.0.0-beta.17"; | ||
export declare const version = "5.0.0-beta.18"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
// This file is autogenerated by /scripts/postversion.mjs | ||
exports.version = "5.0.0-beta.17"; | ||
exports.version = "5.0.0-beta.18"; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "graphile-build", | ||
"version": "5.0.0-beta.17", | ||
"version": "5.0.0-beta.18", | ||
"description": "Build a GraphQL schema from plugins", | ||
@@ -49,2 +49,3 @@ "type": "commonjs", | ||
"semver": "^7.5.4", | ||
"tamedevil": "^0.0.0-beta.7", | ||
"tslib": "^2.6.2" | ||
@@ -56,3 +57,3 @@ }, | ||
"peerDependencies": { | ||
"grafast": "^0.1.1-beta.7", | ||
"grafast": "^0.1.1-beta.8", | ||
"graphile-config": "^0.0.1-beta.8", | ||
@@ -68,3 +69,3 @@ "graphql": "^16.1.0-experimental-stream-defer.6" | ||
"@types/jest": "^29.5.4", | ||
"graphile-export": "^0.0.2-beta.12", | ||
"graphile-export": "^0.0.2-beta.13", | ||
"graphql": "16.1.0-experimental-stream-defer.6", | ||
@@ -71,0 +72,0 @@ "jest": "^29.6.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
464698
5164
15
+ Addedtamedevil@^0.0.0-beta.7