diff --git a/src/execution/execute.js b/src/execution/execute.js index d15e3dceab..299647173c 100644 --- a/src/execution/execute.js +++ b/src/execution/execute.js @@ -96,12 +96,12 @@ type ExecutionContext = { /** * The result of GraphQL execution. * - * - `data` is the result of a successful execution of the query. * - `errors` is included when any errors occurred as a non-empty array. + * - `data` is the result of a successful execution of the query. */ export type ExecutionResult = { - data?: ?{[key: string]: mixed}; errors?: Array; + data?: ?{[key: string]: mixed}; }; /** @@ -166,7 +166,7 @@ export function execute( if (!context.errors.length) { return { data }; } - return { data, errors: context.errors }; + return { errors: context.errors, data }; }); }