graphile-build
Advanced tools
Comparing version 4.9.0 to 4.10.0
@@ -183,4 +183,4 @@ "use strict"; | ||
exports.buildSchema = buildSchema; | ||
const defaultPlugins = [_plugins.SwallowErrorsPlugin, _plugins.StandardTypesPlugin, _plugins.NodePlugin, _plugins.QueryPlugin, _plugins.MutationPlugin, _plugins.SubscriptionPlugin, _plugins.ClientMutationIdDescriptionPlugin, _plugins.MutationPayloadQueryPlugin, _plugins.AddQueriesToSubscriptionsPlugin]; | ||
const defaultPlugins = [_plugins.SwallowErrorsPlugin, _plugins.StandardTypesPlugin, _plugins.NodePlugin, _plugins.QueryPlugin, _plugins.MutationPlugin, _plugins.SubscriptionPlugin, _plugins.ClientMutationIdDescriptionPlugin, _plugins.MutationPayloadQueryPlugin, _plugins.AddQueriesToSubscriptionsPlugin, _plugins.TrimEmptyDescriptionsPlugin]; | ||
exports.defaultPlugins = defaultPlugins; | ||
//# sourceMappingURL=index.js.map |
@@ -737,2 +737,3 @@ "use strict"; | ||
}, | ||
wrapDescription: _utils.wrapDescription, | ||
swallowError: _swallowError.default, | ||
@@ -739,0 +740,0 @@ // resolveNode: EXPERIMENTAL, API might change! |
@@ -26,3 +26,3 @@ "use strict"; | ||
return extend(field, { | ||
description: "An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client." | ||
description: build.wrapDescription("An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client.", "field") | ||
}, `Tweaking '${fieldName}' field in '${Self.name}'`); | ||
@@ -47,3 +47,3 @@ }, ["ClientMutationIdDescription"]); | ||
return extend(field, { | ||
description: "The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations." | ||
description: build.wrapDescription("The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations.", "field") | ||
}, `Tweaking '${fieldName}' field in '${Self.name}'`); | ||
@@ -69,3 +69,3 @@ }, ["ClientMutationIdDescription"]); | ||
input: extend(args.input, { | ||
description: "The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields." | ||
description: build.wrapDescription("The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields.", "arg") | ||
}, `Adding a description to input arg for field '${fieldName}' field in '${Self.name}'`) | ||
@@ -72,0 +72,0 @@ }; |
@@ -60,2 +60,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "TrimEmptyDescriptionsPlugin", { | ||
enumerable: true, | ||
get: function () { | ||
return _TrimEmptyDescriptionsPlugin.default; | ||
} | ||
}); | ||
@@ -80,3 +86,5 @@ var _ClientMutationIdDescriptionPlugin = _interopRequireDefault(require("./ClientMutationIdDescriptionPlugin")); | ||
var _TrimEmptyDescriptionsPlugin = _interopRequireDefault(require("./TrimEmptyDescriptionsPlugin")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=index.js.map |
@@ -30,3 +30,3 @@ "use strict"; | ||
query: { | ||
description: "Our root query field type. Allows us to run any query from our mutation payload.", | ||
description: build.wrapDescription("Our root query field type. Allows us to run any query from our mutation payload.", "field"), | ||
type: Query, | ||
@@ -33,0 +33,0 @@ |
@@ -36,3 +36,3 @@ "use strict"; | ||
name: inflection.builtin("Mutation"), | ||
description: "The root mutation type which contains root level fields which mutate data." | ||
description: build.wrapDescription("The root mutation type which contains root level fields which mutate data.", "type") | ||
}, { | ||
@@ -39,0 +39,0 @@ __origin: `graphile-build built-in (root mutation type)`, |
@@ -86,3 +86,3 @@ "use strict"; | ||
name: inflection.builtin("Node"), | ||
description: "An object with a globally unique `ID`.", | ||
description: build.wrapDescription("An object with a globally unique `ID`.", "type"), | ||
resolveType: value => { | ||
@@ -98,3 +98,3 @@ if (value === $$isQuery) { | ||
[nodeIdFieldName]: { | ||
description: "A globally unique identifier. Can be used in various places throughout the system to identify this single value.", | ||
description: build.wrapDescription("A globally unique identifier. Can be used in various places throughout the system to identify this single value.", "field"), | ||
type: new GraphQLNonNull(GraphQLID) | ||
@@ -155,3 +155,3 @@ } | ||
[nodeIdFieldName]: { | ||
description: "The root query type must be a `Node` to work well with Relay 1 mutations. This just resolves to `query`.", | ||
description: build.wrapDescription("The root query type must be a `Node` to work well with Relay 1 mutations. This just resolves to `query`.", "field"), | ||
type: new GraphQLNonNull(GraphQLID), | ||
@@ -167,7 +167,7 @@ | ||
}) => ({ | ||
description: "Fetches an object given its globally unique `ID`.", | ||
description: build.wrapDescription("Fetches an object given its globally unique `ID`.", "field"), | ||
type: getTypeByName(inflection.builtin("Node")), | ||
args: { | ||
[nodeIdFieldName]: { | ||
description: "The globally unique `ID`.", | ||
description: build.wrapDescription("The globally unique `ID`.", "arg"), | ||
type: new GraphQLNonNull(GraphQLID) | ||
@@ -174,0 +174,0 @@ } |
@@ -24,3 +24,3 @@ "use strict"; | ||
const queryType = newWithHooks(GraphQLObjectType, { | ||
description: "The root query type which gives access points into the data universe.", | ||
description: build.wrapDescription("The root query type which gives access points into the data universe.", "type"), | ||
name: inflection.builtin("Query"), | ||
@@ -32,3 +32,3 @@ isTypeOf: (value, _context, info) => info.parentType == null || value === $$isQuery, | ||
query: { | ||
description: "Exposes the root query type nested one level down. This is helpful for Relay 1 which can only query top level fields if they are in a particular form.", | ||
description: build.wrapDescription("Exposes the root query type nested one level down. This is helpful for Relay 1 which can only query top level fields if they are in a particular form.", "field"), | ||
type: new GraphQLNonNull(Self), | ||
@@ -35,0 +35,0 @@ |
@@ -46,3 +46,3 @@ "use strict"; | ||
name: inflection.builtin("PageInfo"), | ||
description: "Information about pagination in a connection.", | ||
description: build.wrapDescription("Information about pagination in a connection.", "type"), | ||
fields: ({ | ||
@@ -60,3 +60,3 @@ fieldWithHooks | ||
return { | ||
description: "When paginating forwards, are there more items?", | ||
description: build.wrapDescription("When paginating forwards, are there more items?", "field"), | ||
type: new GraphQLNonNull(GraphQLBoolean) | ||
@@ -76,3 +76,3 @@ }; | ||
return { | ||
description: "When paginating backwards, are there more items?", | ||
description: build.wrapDescription("When paginating backwards, are there more items?", "field"), | ||
type: new GraphQLNonNull(GraphQLBoolean) | ||
@@ -79,0 +79,0 @@ }; |
@@ -58,3 +58,3 @@ "use strict"; | ||
name: inflection.builtin("Subscription"), | ||
description: live ? liveDescription : description | ||
description: build.wrapDescription(live ? liveDescription : description, "type") | ||
}, { | ||
@@ -61,0 +61,0 @@ __origin: `graphile-build built-in (root subscription type)`, |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.singularize = exports.pluralize = exports.upperCamelCase = exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.bindAll = void 0; | ||
exports.wrapDescription = exports.singularize = exports.pluralize = exports.upperCamelCase = exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.bindAll = void 0; | ||
@@ -58,5 +58,47 @@ var _upperFirst = _interopRequireDefault(require("lodash/upperFirst")); | ||
const singularize = str => _pluralize.default.singular(str); | ||
const singularize = str => _pluralize.default.singular(str); // Copied from GraphQL v14, MIT license (c) GraphQL Contributors. | ||
exports.singularize = singularize; | ||
function breakLine(line, maxLen) { | ||
const parts = line.split(new RegExp(`((?: |^).{15,${maxLen - 40}}(?= |$))`)); | ||
if (parts.length < 4) { | ||
return [line]; | ||
} | ||
const sublines = [parts[0] + parts[1] + parts[2]]; | ||
for (let i = 3; i < parts.length; i += 2) { | ||
sublines.push(parts[i].slice(1) + parts[i + 1]); | ||
} | ||
return sublines; | ||
} | ||
/** | ||
* Only use this on descriptions that are plain text, or that we create | ||
* manually in code; since descriptions are markdown, it's not safe to use on | ||
* descriptions that contain code blocks or long inline code strings. | ||
*/ | ||
const wrapDescription = (description, position) => { | ||
const indentationLength = position === "root" ? 0 : position === "type" ? 0 : position === "field" ? 2 : position === "arg" ? 4 : 0; // This follows the implementation from GraphQL v14 to make our GraphQL v15 | ||
// schema more similar. Ref: | ||
// https://github.com/graphql/graphql-js/pull/2223/files | ||
const maxLen = 120 - indentationLength; | ||
return description.split("\n").map(line => { | ||
if (line.length < maxLen + 5) { | ||
return line; | ||
} // For > 120 character long lines, cut at space boundaries into sublines | ||
// of ~80 chars. | ||
return breakLine(line, maxLen).join("\n"); | ||
}).join("\n"); | ||
}; | ||
exports.wrapDescription = wrapDescription; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "graphile-build", | ||
"version": "4.9.0", | ||
"version": "4.10.0", | ||
"description": "Build a GraphQL schema from plugins", | ||
@@ -36,3 +36,3 @@ "main": "node8plus/index.js", | ||
"debug": "^4.1.1", | ||
"graphql-parse-resolve-info": "4.9.0", | ||
"graphql-parse-resolve-info": "4.10.0", | ||
"iterall": "^1.2.2", | ||
@@ -52,6 +52,6 @@ "lodash": ">=4 <5", | ||
"jest": "25.x", | ||
"jest-serializer-graphql-schema": "4.9.0" | ||
"jest-serializer-graphql-schema": "4.10.0" | ||
}, | ||
"peerDependencies": { | ||
"graphql": ">=0.9 <0.14 || ^14.0.2" | ||
"graphql": ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" | ||
}, | ||
@@ -62,3 +62,3 @@ "files": [ | ||
], | ||
"gitHead": "a575f0ac46f7636e726ed9092a374aef65ef23eb" | ||
"gitHead": "c20e6827fa3fd1de9029b9cb77de71bf75a61f5a" | ||
} |
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
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
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
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
393855
66
2840
+ Addedgraphql@15.9.0(transitive)
+ Addedgraphql-parse-resolve-info@4.10.0(transitive)
- Removedgraphql@14.7.0(transitive)
- Removedgraphql-parse-resolve-info@4.9.0(transitive)