graphile-build
Advanced tools
Comparing version 4.1.0 to 4.3.0
@@ -580,3 +580,10 @@ "use strict"; | ||
camelCase: _utils.camelCase, | ||
constantCase: _utils.constantCase | ||
constantCase: _utils.constantCase, | ||
// Core type names | ||
query: () => "Query", | ||
mutation: () => "Mutation", | ||
subscription: () => "Subscription", | ||
node: () => "Node", | ||
pageInfo: () => "PageInfo" | ||
}, | ||
@@ -583,0 +590,0 @@ swallowError: _swallowError2.default, |
@@ -9,3 +9,3 @@ "use strict"; | ||
builder.hook("GraphQLObjectType:fields", (fields, build, context) => { | ||
const { $$isQuery, extend, getTypeByName } = build; | ||
const { $$isQuery, extend, getTypeByName, inflection } = build; | ||
const { | ||
@@ -18,3 +18,3 @@ scope: { isMutationPayload }, | ||
} | ||
const Query = getTypeByName("Query"); | ||
const Query = getTypeByName(inflection.query()); | ||
return extend(fields, { | ||
@@ -21,0 +21,0 @@ query: { |
@@ -27,6 +27,7 @@ "use strict"; | ||
extend, | ||
graphql: { GraphQLObjectType } | ||
graphql: { GraphQLObjectType }, | ||
inflection | ||
} = build; | ||
const Mutation = newWithHooks(GraphQLObjectType, { | ||
name: "Mutation", | ||
name: inflection.mutation(), | ||
description: "The root mutation type which contains root level fields which mutate data." | ||
@@ -33,0 +34,0 @@ }, { |
@@ -69,11 +69,12 @@ "use strict"; | ||
getNullableType | ||
} | ||
}, | ||
inflection | ||
} = build; | ||
let Query; | ||
newWithHooks(GraphQLInterfaceType, { | ||
name: "Node", | ||
name: inflection.node(), | ||
description: "An object with a globally unique `ID`.", | ||
resolveType: value => { | ||
if (value === $$isQuery) { | ||
if (!Query) Query = getTypeByName("Query"); | ||
if (!Query) Query = getTypeByName(inflection.query()); | ||
return Query; | ||
@@ -97,3 +98,3 @@ } else if (value[$$nodeType]) { | ||
builder.hook("GraphQLObjectType:interfaces", function addNodeIdToQuery(interfaces, build, context) { | ||
const { getTypeByName } = build; | ||
const { getTypeByName, inflection } = build; | ||
const { | ||
@@ -105,3 +106,3 @@ scope: { isRootQuery } | ||
} | ||
const Type = getTypeByName("Node"); | ||
const Type = getTypeByName(inflection.node()); | ||
if (Type) { | ||
@@ -125,3 +126,4 @@ return [...interfaces, Type]; | ||
extend, | ||
graphql: { GraphQLNonNull, GraphQLID } | ||
graphql: { GraphQLNonNull, GraphQLID }, | ||
inflection | ||
} = build; | ||
@@ -138,3 +140,3 @@ return extend(fields, { | ||
description: "Fetches an object given its globally unique `ID`.", | ||
type: getTypeByName("Node"), | ||
type: getTypeByName(inflection.node()), | ||
args: { | ||
@@ -141,0 +143,0 @@ [nodeIdFieldName]: { |
@@ -16,7 +16,8 @@ "use strict"; | ||
extend, | ||
graphql: { GraphQLObjectType, GraphQLNonNull } | ||
graphql: { GraphQLObjectType, GraphQLNonNull }, | ||
inflection | ||
} = build; | ||
const queryType = newWithHooks(GraphQLObjectType, { | ||
description: "The root query type which gives access points into the data universe.", | ||
name: "Query", | ||
name: inflection.query(), | ||
isTypeOf: (value, _context, info) => info.parentType == null || value === $$isQuery, | ||
@@ -23,0 +24,0 @@ fields: ({ Self }) => ({ |
@@ -32,3 +32,4 @@ "use strict"; | ||
newWithHooks, | ||
graphql: { GraphQLNonNull, GraphQLObjectType, GraphQLBoolean } | ||
graphql: { GraphQLNonNull, GraphQLObjectType, GraphQLBoolean }, | ||
inflection | ||
} = build; | ||
@@ -38,3 +39,3 @@ // https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo | ||
newWithHooks(GraphQLObjectType, { | ||
name: "PageInfo", | ||
name: inflection.pageInfo(), | ||
description: "Information about pagination in a connection.", | ||
@@ -41,0 +42,0 @@ fields: ({ fieldWithHooks }) => ({ |
@@ -27,6 +27,7 @@ "use strict"; | ||
extend, | ||
graphql: { GraphQLObjectType } | ||
graphql: { GraphQLObjectType }, | ||
inflection | ||
} = build; | ||
const Subscription = newWithHooks(GraphQLObjectType, { | ||
name: "Subscription", | ||
name: inflection.subscription(), | ||
description: "The root subscription type which contains root level fields which mutate data." | ||
@@ -33,0 +34,0 @@ }, { |
@@ -127,4 +127,4 @@ "use strict"; | ||
} | ||
if (this._currentPluginName && !fn.displayName) { | ||
fn.displayName = `${this._currentPluginName}/${hookName}/${fn.displayName || fn.name || "anonymous"}`; | ||
if (this._currentPluginName) { | ||
fn.displayName = `${this._currentPluginName}/${hookName}/${fn.displayName || fn.name || "unnamed"}`; | ||
} | ||
@@ -131,0 +131,0 @@ this.hooks[hookName].push(fn); |
@@ -23,9 +23,9 @@ "use strict"; | ||
} else { | ||
const errorSnippet = e && typeof e.toString === "function" ? String(e).replace(/\n.*/g, "").substr(0, 160).trim() : null; | ||
const errorSnippet = e && typeof e.toString === "function" ? String(e).replace(/\n.*/g, "").substr(0, 320).trim() : null; | ||
if (errorSnippet) { | ||
// eslint-disable-next-line no-console | ||
console.warn(`Recoverable error occurred; use envvar 'DEBUG="graphile-build:warn"' for full error (see: http://graphile.org/postgraphile/debugging )\n> ${errorSnippet}…`); | ||
console.warn(`Recoverable error occurred; use envvar 'DEBUG="graphile-build:warn"' for full error (see: https://graphile.org/postgraphile/debugging )\n> ${errorSnippet}…`); | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.warn(`Recoverable error occurred; use envvar 'DEBUG="graphile-build:warn"' for error (see: http://graphile.org/postgraphile/debugging )`); | ||
console.warn(`Recoverable error occurred; use envvar 'DEBUG="graphile-build:warn"' for error (see: https://graphile.org/postgraphile/debugging )`); | ||
} | ||
@@ -32,0 +32,0 @@ debugWarn(e); |
{ | ||
"name": "graphile-build", | ||
"version": "4.1.0", | ||
"version": "4.3.0", | ||
"description": "Build a GraphQL schema from plugins", | ||
@@ -61,3 +61,3 @@ "main": "node8plus/index.js", | ||
], | ||
"gitHead": "e5b1ba93ce550ba51da5e11cd644e3efdfc93cbd" | ||
"gitHead": "adae926ba5801f62ec1a8ec5c456271fe744f8b0" | ||
} |
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
258264
35591
1728