graphile-build
Advanced tools
Comparing version 4.3.0 to 4.3.1
@@ -582,8 +582,33 @@ "use strict"; | ||
// Core type names | ||
query: () => "Query", | ||
mutation: () => "Mutation", | ||
subscription: () => "Subscription", | ||
node: () => "Node", | ||
pageInfo: () => "PageInfo" | ||
// Built-in names (allows you to override these in the output schema) | ||
builtin: name => { | ||
/* | ||
* e.g.: | ||
* | ||
* graphile-build: | ||
* | ||
* - Query | ||
* - Mutation | ||
* - Subscription | ||
* - Node | ||
* - PageInfo | ||
* | ||
* graphile-build-pg: | ||
* | ||
* - Interval | ||
* - BigInt | ||
* - BigFloat | ||
* - BitString | ||
* - Point | ||
* - Date | ||
* - Datetime | ||
* - Time | ||
* - JSON | ||
* - UUID | ||
* - InternetAddress | ||
* | ||
* Other plugins may add their own builtins too; try and avoid conflicts! | ||
*/ | ||
return name; | ||
} | ||
}, | ||
@@ -590,0 +615,0 @@ swallowError: _swallowError2.default, |
@@ -17,3 +17,3 @@ "use strict"; | ||
} | ||
const Query = getTypeByName(inflection.query()); | ||
const Query = getTypeByName(inflection.builtin("Query")); | ||
return extend(fields, { | ||
@@ -20,0 +20,0 @@ query: { |
@@ -31,3 +31,3 @@ "use strict"; | ||
const Mutation = newWithHooks(GraphQLObjectType, { | ||
name: inflection.mutation(), | ||
name: inflection.builtin("Mutation"), | ||
description: "The root mutation type which contains root level fields which mutate data." | ||
@@ -34,0 +34,0 @@ }, { |
@@ -74,7 +74,7 @@ "use strict"; | ||
newWithHooks(GraphQLInterfaceType, { | ||
name: inflection.node(), | ||
name: inflection.builtin("Node"), | ||
description: "An object with a globally unique `ID`.", | ||
resolveType: value => { | ||
if (value === $$isQuery) { | ||
if (!Query) Query = getTypeByName(inflection.query()); | ||
if (!Query) Query = getTypeByName(inflection.builtin("Query")); | ||
return Query; | ||
@@ -105,3 +105,3 @@ } else if (value[$$nodeType]) { | ||
} | ||
const Type = getTypeByName(inflection.node()); | ||
const Type = getTypeByName(inflection.builtin("Node")); | ||
if (Type) { | ||
@@ -138,3 +138,3 @@ return [...interfaces, Type]; | ||
description: "Fetches an object given its globally unique `ID`.", | ||
type: getTypeByName(inflection.node()), | ||
type: getTypeByName(inflection.builtin("Node")), | ||
args: { | ||
@@ -141,0 +141,0 @@ [nodeIdFieldName]: { |
@@ -21,3 +21,3 @@ "use strict"; | ||
description: "The root query type which gives access points into the data universe.", | ||
name: inflection.query(), | ||
name: inflection.builtin("Query"), | ||
isTypeOf: (value, _context, info) => info.parentType == null || value === $$isQuery, | ||
@@ -24,0 +24,0 @@ fields: ({ Self }) => ({ |
@@ -38,3 +38,3 @@ "use strict"; | ||
newWithHooks(GraphQLObjectType, { | ||
name: inflection.pageInfo(), | ||
name: inflection.builtin("PageInfo"), | ||
description: "Information about pagination in a connection.", | ||
@@ -41,0 +41,0 @@ fields: ({ fieldWithHooks }) => ({ |
@@ -31,3 +31,3 @@ "use strict"; | ||
const Subscription = newWithHooks(GraphQLObjectType, { | ||
name: inflection.subscription(), | ||
name: inflection.builtin("Subscription"), | ||
description: "The root subscription type which contains root level fields which mutate data." | ||
@@ -34,0 +34,0 @@ }, { |
{ | ||
"name": "graphile-build", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"description": "Build a GraphQL schema from plugins", | ||
@@ -61,3 +61,3 @@ "main": "node8plus/index.js", | ||
], | ||
"gitHead": "adae926ba5801f62ec1a8ec5c456271fe744f8b0" | ||
"gitHead": "255f2aa4456c9130d8565afbd14727bccd07583b" | ||
} |
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
260154
1753