@@ -29,20 +29,16 @@ const { execute } = require('graphql'); // CommonJS
29
29
### execute
30
30
31
31
``` ts
32
- export function execute({
32
+ export function execute(
33
33
schema : GraphQLSchema ,
34
- document : DocumentNode ,
35
- rootValue ?: unknown ,
36
- contextValue ?: unknown ,
34
+ documentAST : Document ,
35
+ rootValue ? : mixed ,
36
+ contextValue ? : mixed ,
37
37
variableValues ? : { [key : string ]: mixed },
38
38
operationName ? : string ,
39
- fieldResolver ?: Maybe <GraphQLFieldResolver <any , any >>;
40
- typeResolver ?: Maybe <GraphQLTypeResolver <any , any >>;
41
- subscribeFieldResolver ?: Maybe <GraphQLFieldResolver <any , any >>;
42
- options ?: { maxCoercionErrors ?: number };
43
- }): PromiseOrValue <ExecutionResult >;
39
+ ): MaybePromise <ExecutionResult >;
44
40
45
- type PromiseOrValue <T > = Promise <T > | T ;
41
+ type MaybePromise <T > = Promise <T > | T ;
46
42
47
43
interface ExecutionResult <
48
44
TData = ObjMap <unknown >,
@@ -65,32 +61,21 @@ a GraphQLError will be thrown immediately explaining the invalid input.
65
61
executing the query, ` errors ` is null if no errors occurred, and is a
66
62
non-empty array if an error occurred.
67
63
68
- #### options
69
-
70
- ##### maxCoercionErrors
71
-
72
- Set the maximum number of errors allowed for coercing (defaults to 50).
73
-
74
64
### executeSync
75
65
76
66
``` ts
77
- export function executeSync({
67
+ export function executeSync(
78
68
schema : GraphQLSchema ,
79
- document : DocumentNode ,
80
- rootValue ?: unknown ,
81
- contextValue ?: unknown ,
69
+ documentAST : Document ,
70
+ rootValue ? : mixed ,
71
+ contextValue ? : mixed ,
82
72
variableValues ? : { [key : string ]: mixed },
83
73
operationName ? : string ,
84
- fieldResolver ?: Maybe <GraphQLFieldResolver <any , any >>;
85
- typeResolver ?: Maybe <GraphQLTypeResolver <any , any >>;
86
- subscribeFieldResolver ?: Maybe <GraphQLFieldResolver <any , any >>;
87
- options ?: { maxCoercionErrors ?: number };
88
- }): ExecutionResult ;
74
+ ): ExecutionResult ;
89
75
90
76
type ExecutionResult = {
91
- errors? : ReadonlyArray <GraphQLError >;
92
- data? : TData | null ;
93
- extensions? : TExtensions ;
77
+ data: Object ;
78
+ errors? : GraphQLError [];
94
79
};
95
80
```
96
81
0 commit comments