graphile-build
Advanced tools
Comparing version 4.0.0 to 4.1.0-alpha.0
@@ -52,2 +52,4 @@ "use strict"; | ||
let recurseDataGeneratorsForFieldWarned = false; | ||
const isString = str => typeof str === "string"; | ||
@@ -273,3 +275,16 @@ const isDev = ["test", "development"].indexOf(process.env.NODE_ENV) >= 0; | ||
}; | ||
const recurseDataGeneratorsForField = fieldName => { | ||
const recurseDataGeneratorsForField = (fieldName, iKnowWhatIAmDoing) => { | ||
/* | ||
* Recursing data generators is not safe in general; however there | ||
* are certain exceptions - for example when you know there are no | ||
* "dynamic" data generator fields - e.g. where the GraphQL alias is | ||
* not used at all. In PostGraphile the only case of this is the | ||
* PageInfo object as none of the fields accept arguments, and they | ||
* do not rely on the GraphQL query alias to store the result. | ||
*/ | ||
if (!iKnowWhatIAmDoing && !recurseDataGeneratorsForFieldWarned) { | ||
recurseDataGeneratorsForFieldWarned = true; | ||
// eslint-disable-next-line no-console | ||
console.error("Use of `recurseDataGeneratorsForField` is NOT SAFE. e.g. `{n1: node { a: field1 }, n2: node { a: field2 } }` cannot resolve correctly."); | ||
} | ||
const fn = (parsedResolveInfoFragment, ReturnType, ...rest) => { | ||
@@ -276,0 +291,0 @@ const { args } = parsedResolveInfoFragment; |
@@ -25,6 +25,6 @@ import { | ||
export type Plugin = ( | ||
builder: SchemaBuilder, | ||
options: Options | ||
) => Promise<void> | void; | ||
export interface Plugin { | ||
(builder: SchemaBuilder, options: Options): Promise<void> | void; | ||
displayName?: string; | ||
} | ||
@@ -31,0 +31,0 @@ export type TriggerChangeType = () => void; |
{ | ||
"name": "graphile-build", | ||
"version": "4.0.0", | ||
"version": "4.1.0-alpha.0", | ||
"description": "Build a GraphQL schema from plugins", | ||
@@ -58,3 +58,4 @@ "main": "node8plus/index.js", | ||
"index.js" | ||
] | ||
], | ||
"gitHead": "b737bd393854b5fda265c7b30b916b8608c75c31" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
255568
1709
1