@graphql-tools/utils 7.0.0-alpha-624d205a.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Interfaces.d.ts +18 -17
- package/es5/Interfaces.d.ts +18 -17
- package/es5/package.json +1 -1
- package/package.json +1 -1
package/Interfaces.d.ts
CHANGED
|
@@ -21,35 +21,36 @@ export interface GraphQLParseOptions {
|
|
|
21
21
|
allowLegacySDLImplementsInterfaces?: boolean;
|
|
22
22
|
experimentalFragmentVariables?: boolean;
|
|
23
23
|
}
|
|
24
|
+
export declare type ValidatorBehavior = 'error' | 'warn' | 'ignore';
|
|
24
25
|
/**
|
|
25
26
|
* Options for validating resolvers
|
|
26
27
|
*/
|
|
27
28
|
export interface IResolverValidationOptions {
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
* arguments. Defaults to `
|
|
30
|
+
* Enable to require a resolver to be defined for any field that has
|
|
31
|
+
* arguments. Defaults to `ignore`.
|
|
31
32
|
*/
|
|
32
|
-
requireResolversForArgs?:
|
|
33
|
+
requireResolversForArgs?: ValidatorBehavior;
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
-
* a return type that isn't a scalar. Defaults to `
|
|
35
|
+
* Enable to require a resolver to be defined for any field which has
|
|
36
|
+
* a return type that isn't a scalar. Defaults to `ignore`.
|
|
36
37
|
*/
|
|
37
|
-
requireResolversForNonScalar?:
|
|
38
|
+
requireResolversForNonScalar?: ValidatorBehavior;
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
-
* in the schema. Defaults to `
|
|
40
|
+
* Enable to require a resolver for be defined for all fields defined
|
|
41
|
+
* in the schema. Defaults to `ignore`.
|
|
41
42
|
*/
|
|
42
|
-
requireResolversForAllFields?:
|
|
43
|
+
requireResolversForAllFields?: ValidatorBehavior;
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
* Defaults to `
|
|
45
|
+
* Enable to require a `resolveType()` for Interface and Union types.
|
|
46
|
+
* Defaults to `ignore`.
|
|
46
47
|
*/
|
|
47
|
-
requireResolversForResolveType?:
|
|
48
|
+
requireResolversForResolveType?: ValidatorBehavior;
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
-
* actually exist in the schema. Defaults to `
|
|
50
|
+
* Enable to require all defined resolvers to match fields that
|
|
51
|
+
* actually exist in the schema. Defaults to `error` to catch common errors.
|
|
51
52
|
*/
|
|
52
|
-
|
|
53
|
+
requireResolversToMatchSchema?: ValidatorBehavior;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* Configuration object for adding resolvers to a schema
|
|
@@ -122,8 +123,8 @@ export declare type RenameTypesOptions = {
|
|
|
122
123
|
renameScalars: boolean;
|
|
123
124
|
};
|
|
124
125
|
export declare type IFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn;
|
|
125
|
-
export declare type ITypedef = (() => Array<ITypedef>)
|
|
126
|
-
export declare type ITypeDefinitions =
|
|
126
|
+
export declare type ITypedef = string | DocumentNode | (() => Array<ITypedef>);
|
|
127
|
+
export declare type ITypeDefinitions = string | DocumentNode | Array<ITypedef>;
|
|
127
128
|
export declare type IObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
|
128
129
|
[key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
|
|
129
130
|
} & {
|
package/es5/Interfaces.d.ts
CHANGED
|
@@ -21,35 +21,36 @@ export interface GraphQLParseOptions {
|
|
|
21
21
|
allowLegacySDLImplementsInterfaces?: boolean;
|
|
22
22
|
experimentalFragmentVariables?: boolean;
|
|
23
23
|
}
|
|
24
|
+
export declare type ValidatorBehavior = 'error' | 'warn' | 'ignore';
|
|
24
25
|
/**
|
|
25
26
|
* Options for validating resolvers
|
|
26
27
|
*/
|
|
27
28
|
export interface IResolverValidationOptions {
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
* arguments. Defaults to `
|
|
30
|
+
* Enable to require a resolver to be defined for any field that has
|
|
31
|
+
* arguments. Defaults to `ignore`.
|
|
31
32
|
*/
|
|
32
|
-
requireResolversForArgs?:
|
|
33
|
+
requireResolversForArgs?: ValidatorBehavior;
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
-
* a return type that isn't a scalar. Defaults to `
|
|
35
|
+
* Enable to require a resolver to be defined for any field which has
|
|
36
|
+
* a return type that isn't a scalar. Defaults to `ignore`.
|
|
36
37
|
*/
|
|
37
|
-
requireResolversForNonScalar?:
|
|
38
|
+
requireResolversForNonScalar?: ValidatorBehavior;
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
-
* in the schema. Defaults to `
|
|
40
|
+
* Enable to require a resolver for be defined for all fields defined
|
|
41
|
+
* in the schema. Defaults to `ignore`.
|
|
41
42
|
*/
|
|
42
|
-
requireResolversForAllFields?:
|
|
43
|
+
requireResolversForAllFields?: ValidatorBehavior;
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
* Defaults to `
|
|
45
|
+
* Enable to require a `resolveType()` for Interface and Union types.
|
|
46
|
+
* Defaults to `ignore`.
|
|
46
47
|
*/
|
|
47
|
-
requireResolversForResolveType?:
|
|
48
|
+
requireResolversForResolveType?: ValidatorBehavior;
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
-
* actually exist in the schema. Defaults to `
|
|
50
|
+
* Enable to require all defined resolvers to match fields that
|
|
51
|
+
* actually exist in the schema. Defaults to `error` to catch common errors.
|
|
51
52
|
*/
|
|
52
|
-
|
|
53
|
+
requireResolversToMatchSchema?: ValidatorBehavior;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* Configuration object for adding resolvers to a schema
|
|
@@ -122,8 +123,8 @@ export declare type RenameTypesOptions = {
|
|
|
122
123
|
renameScalars: boolean;
|
|
123
124
|
};
|
|
124
125
|
export declare type IFieldResolver<TSource, TContext, TArgs = Record<string, any>, TReturn = any> = (source: TSource, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TReturn;
|
|
125
|
-
export declare type ITypedef = (() => Array<ITypedef>)
|
|
126
|
-
export declare type ITypeDefinitions =
|
|
126
|
+
export declare type ITypedef = string | DocumentNode | (() => Array<ITypedef>);
|
|
127
|
+
export declare type ITypeDefinitions = string | DocumentNode | Array<ITypedef>;
|
|
127
128
|
export declare type IObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
|
128
129
|
[key: string]: IFieldResolver<TSource, TContext, TArgs> | IFieldResolverOptions<TSource, TContext>;
|
|
129
130
|
} & {
|
package/es5/package.json
CHANGED