Socket
Socket
Sign inDemoInstall

graphile-build

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphile-build - npm Package Compare versions

Comparing version 5.0.0-alpha.16 to 5.0.0-alpha.17

22

CHANGELOG.md
# graphile-build
## 5.0.0-alpha.17
### Patch Changes
- [#433](https://github.com/benjie/postgraphile-private/pull/433)
[`5491e10b0`](https://github.com/benjie/postgraphile-private/commit/5491e10b0f1629e607e7385985315169e156071d)
Thanks [@benjie](https://github.com/benjie)! - Improve error messages from
custom string scalars when they cannot be parsed as a string.
- [#438](https://github.com/benjie/postgraphile-private/pull/438)
[`a22830b2f`](https://github.com/benjie/postgraphile-private/commit/a22830b2f293b50a244ac18e1601d7579b450c7d)
Thanks [@benjie](https://github.com/benjie)! - Plugin name now automatically
used in `provides` for every hook, allowing ordering hooks before/after their
equivalents in other plugins.
- Updated dependencies
[[`ea003ca3a`](https://github.com/benjie/postgraphile-private/commit/ea003ca3a8f68fb87dca603582e47981ed033996),
[`57d88b5fa`](https://github.com/benjie/postgraphile-private/commit/57d88b5fa3ed296210c1fcb223452213fd57985b),
[`a22830b2f`](https://github.com/benjie/postgraphile-private/commit/a22830b2f293b50a244ac18e1601d7579b450c7d),
[`9f87a26b1`](https://github.com/benjie/postgraphile-private/commit/9f87a26b10e5539aa88cfd9909e265513e941fd5)]:
- grafast@0.0.1-alpha.15
- graphile-config@0.0.1-alpha.7
## 5.0.0-alpha.16

@@ -4,0 +26,0 @@

2

dist/behavior.js

@@ -22,3 +22,3 @@ "use strict";

provides: ["default"],
before: ["inferred"],
before: ["inferred", "override"],
callback: (behavior) => [lhs, behavior],

@@ -25,0 +25,0 @@ };

@@ -16,3 +16,3 @@ "use strict";

const { options: { jsonScalarAsString }, inflection, stringTypeSpec, graphql: { Kind, GraphQLError }, } = build;
build.registerScalarType(inflection.builtin("BigInt"), {}, () => stringTypeSpec(build.wrapDescription("A signed eight-byte integer. The upper big integer values are greater than the max value for a JavaScript number. Therefore all big integers will be output as strings and not numbers.", "type")), "graphile-build built-in (BigInt type)");
build.registerScalarType(inflection.builtin("BigInt"), {}, () => stringTypeSpec(build.wrapDescription("A signed eight-byte integer. The upper big integer values are greater than the max value for a JavaScript number. Therefore all big integers will be output as strings and not numbers.", "type"), undefined, inflection.builtin("BigInt")), "graphile-build built-in (BigInt type)");
build.registerCursorConnection?.({

@@ -23,3 +23,3 @@ typeName: "BigInt",

});
build.registerScalarType(inflection.builtin("BigFloat"), {}, () => stringTypeSpec(build.wrapDescription("A floating point number that requires more precision than IEEE 754 binary 64", "type")), "graphile-build built-in (BigFloat type)");
build.registerScalarType(inflection.builtin("BigFloat"), {}, () => stringTypeSpec(build.wrapDescription("A floating point number that requires more precision than IEEE 754 binary 64", "type"), undefined, inflection.builtin("BigFloat")), "graphile-build built-in (BigFloat type)");
build.registerCursorConnection?.({

@@ -30,3 +30,3 @@ typeName: "BigFloat",

});
build.registerScalarType(inflection.builtin("Datetime"), {}, () => stringTypeSpec(build.wrapDescription("A point in time as described by the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) and, if it has a timezone, [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) standards. Input values that do not conform to both ISO 8601 and RFC 3339 may be coerced, which may lead to unexpected results.", "type")), "graphile-build built-in (Datetime type)");
build.registerScalarType(inflection.builtin("Datetime"), {}, () => stringTypeSpec(build.wrapDescription("A point in time as described by the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) and, if it has a timezone, [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) standards. Input values that do not conform to both ISO 8601 and RFC 3339 may be coerced, which may lead to unexpected results.", "type"), undefined, inflection.builtin("Datetime")), "graphile-build built-in (Datetime type)");
build.registerCursorConnection?.({

@@ -37,3 +37,3 @@ typeName: "Datetime",

});
build.registerScalarType(inflection.builtin("Date"), {}, () => stringTypeSpec(build.wrapDescription("A calendar date in YYYY-MM-DD format.", "type")), "graphile-build built-in (Datetype)");
build.registerScalarType(inflection.builtin("Date"), {}, () => stringTypeSpec(build.wrapDescription("A calendar date in YYYY-MM-DD format.", "type"), undefined, inflection.builtin("Date")), "graphile-build built-in (Datetype)");
build.registerCursorConnection?.({

@@ -49,3 +49,3 @@ typeName: "Date",

return string;
}, [GraphQLError])), "graphile-build built-in (UUID type)");
}, [GraphQLError]), inflection.builtin("UUID")), "graphile-build built-in (UUID type)");
build.registerCursorConnection?.({

@@ -116,3 +116,3 @@ typeName: "UUID",

});
build.registerScalarType(inflection.builtin("XML"), {}, () => stringTypeSpec(build.wrapDescription("An XML document", "type")), "graphile-build built-in (XML type)");
build.registerScalarType(inflection.builtin("XML"), {}, () => stringTypeSpec(build.wrapDescription("An XML document", "type"), undefined, inflection.builtin("XML")), "graphile-build built-in (XML type)");
build.registerCursorConnection?.({

@@ -119,0 +119,0 @@ typeName: "XML",

@@ -16,6 +16,4 @@ "use strict";

const { registerScalarType, inflection } = build;
registerScalarType(inflection.builtin("Cursor"), { isCursorType: true }, () => ({
...utils_js_1.stringScalarSpec,
description: "A location in a connection that can be used for resuming pagination.",
}), "graphile-build built-in (Cursor type)");
const cursorTypeName = inflection.builtin("Cursor");
registerScalarType(cursorTypeName, { isCursorType: true }, () => (0, utils_js_1.stringTypeSpec)("A location in a connection that can be used for resuming pagination.", undefined, cursorTypeName), "graphile-build built-in (Cursor type)");
return _;

@@ -22,0 +20,0 @@ },

@@ -25,7 +25,7 @@ "use strict";

// eslint-disable-next-line no-console
console.warn(`Recoverable error occurred; use envvar 'DEBUG="graphile-build:warn"' for full error (see: https://graphile.org/postgraphile/debugging )\n> ${errorSnippet}…`);
console.warn(`Recoverable error occurred; use envvar 'DEBUG="graphile-build:warn"' for full error (see: https://postgraphile.org/postgraphile/current/debugging )\n> ${errorSnippet}…`);
}
else {
// eslint-disable-next-line no-console
console.warn(`Recoverable error occurred; use envvar 'DEBUG="graphile-build:warn"' for error (see: https://graphile.org/postgraphile/debugging )`);
console.warn(`Recoverable error occurred; use envvar 'DEBUG="graphile-build:warn"' for error (see: https://postgraphile.org/postgraphile/current/debugging )`);
}

@@ -32,0 +32,0 @@ }

@@ -32,8 +32,2 @@ import type { GraphQLNamedType, GraphQLScalarTypeConfig } from "grafast/graphql";

/**
* A GraphQL scalar spec for a scalar that'll be treated as a verbatim string
* in and out (i.e. the type name is really just a hint to the user); purely a
* convenience.
*/
export declare const stringScalarSpec: Readonly<Omit<GraphQLScalarTypeConfig<unknown, unknown>, "name" | "description">>;
/**
* Only use this on descriptions that are plain text, or that we create

@@ -48,3 +42,3 @@ * manually in code; since descriptions are markdown, it's not safe to use on

*/
export declare const stringTypeSpec: (description: string, coerce?: ((input: string) => string) | undefined) => Omit<GraphQLScalarTypeConfig<any, any>, "name">;
export declare const stringTypeSpec: (description: string, coerce?: ((input: string) => string) | undefined, name?: string) => Omit<GraphQLScalarTypeConfig<any, any>, "name">;
/**

@@ -51,0 +45,0 @@ * This is a TypeScript constrained identity function to save having to specify

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.gatherConfig = exports.stringTypeSpec = exports.wrapDescription = exports.stringScalarSpec = exports.isValidObjectType = exports.singularize = exports.pluralize = exports.upperCamelCase = exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.bindAll = 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.EXPORTABLE = void 0;
const tslib_1 = require("tslib");

@@ -83,22 +83,2 @@ const grafast_1 = require("grafast");

}
/**
* A GraphQL scalar spec for a scalar that'll be treated as a verbatim string
* in and out (i.e. the type name is really just a hint to the user); purely a
* convenience.
*/
exports.stringScalarSpec = Object.freeze({
serialize: toString,
parseValue: toString,
parseLiteral: EXPORTABLE((Kind, SafeError) => (ast) => {
if (ast.kind !== Kind.STRING) {
throw new SafeError("Can only parse string values");
}
return ast.value;
}, [graphql_1.Kind, grafast_1.SafeError]),
extensions: {
grafast: {
idempotent: true,
},
},
});
// Copied from GraphQL v14, MIT license (c) GraphQL Contributors.

@@ -156,3 +136,3 @@ /**

*/
const stringTypeSpec = (description, coerce) => ({
const stringTypeSpec = (description, coerce, name) => ({
description,

@@ -164,15 +144,15 @@ serialize: toString,

parseLiteral: coerce
? EXPORTABLE((GraphQLError, Kind, coerce) => (ast) => {
? EXPORTABLE((GraphQLError, Kind, coerce, name) => (ast) => {
if (ast.kind !== Kind.STRING) {
// ERRORS: add name to this error
throw new GraphQLError("Can only parse string values");
throw new GraphQLError(`${name ?? "This scalar"} can only parse string values (kind = '${ast.kind}')`);
}
return coerce(ast.value);
}, [graphql_1.GraphQLError, graphql_1.Kind, coerce])
: EXPORTABLE((GraphQLError, Kind) => (ast) => {
}, [graphql_1.GraphQLError, graphql_1.Kind, coerce, name])
: EXPORTABLE((GraphQLError, Kind, name) => (ast) => {
if (ast.kind !== Kind.STRING) {
throw new GraphQLError("Can only parse string values");
throw new GraphQLError(`${name ?? "This scalar"} can only parse string values (kind='${ast.kind}')`);
}
return ast.value;
}, [graphql_1.GraphQLError, graphql_1.Kind]),
}, [graphql_1.GraphQLError, graphql_1.Kind, name]),
extensions: {

@@ -179,0 +159,0 @@ grafast: {

@@ -1,2 +0,2 @@

export declare const version = "5.0.0-alpha.16";
export declare const version = "5.0.0-alpha.17";
//# sourceMappingURL=version.d.ts.map

@@ -5,3 +5,3 @@ "use strict";

// This file is autogenerated by /scripts/postversion.mjs
exports.version = "5.0.0-alpha.16";
exports.version = "5.0.0-alpha.17";
//# sourceMappingURL=version.js.map
{
"name": "graphile-build",
"version": "5.0.0-alpha.16",
"version": "5.0.0-alpha.17",
"description": "Build a GraphQL schema from plugins",

@@ -44,3 +44,3 @@ "type": "commonjs",

"debug": "^4.3.3",
"graphile-config": "^0.0.1-alpha.6",
"graphile-config": "^0.0.1-alpha.7",
"graphql": "^16.1.0-experimental-stream-defer.6",

@@ -56,4 +56,4 @@ "lodash": "^4.17.21",

"peerDependencies": {
"grafast": "^0.0.1-alpha.14",
"graphile-config": "^0.0.1-alpha.6",
"grafast": "^0.0.1-alpha.15",
"graphile-config": "^0.0.1-alpha.7",
"graphql": "^16.1.0-experimental-stream-defer.6"

@@ -68,3 +68,3 @@ },

"@types/jest": "^27.5.1",
"graphile-export": "^0.0.2-alpha.7",
"graphile-export": "^0.0.2-alpha.8",
"graphql": "16.1.0-experimental-stream-defer.6",

@@ -71,0 +71,0 @@ "jest": "^28.1.3",

@@ -48,2 +48,3 @@ # graphile-build

<td align="center"><a href="https://stellate.co/"><img src="https://graphile.org/images/sponsors/Stellate.png" width="90" height="90" alt="Stellate" /><br />Stellate</a> *</td>
<td align="center"><a href="https://www.accenture.com/"><img src="https://graphile.org/images/sponsors/accenture.svg" width="90" height="90" alt="Accenture" /><br />Accenture</a> *</td>
</tr></table>

@@ -50,0 +51,0 @@

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc