Skip to content

Commit 7d00990

Browse files
committed
Make 'errors' top property in response object.
1 parent 604bf1a commit 7d00990

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/execution/execute.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ type ExecutionContext = {
9696
/**
9797
* The result of GraphQL execution.
9898
*
99-
* - `data` is the result of a successful execution of the query.
10099
* - `errors` is included when any errors occurred as a non-empty array.
100+
* - `data` is the result of a successful execution of the query.
101101
*/
102102
export type ExecutionResult = {
103-
data?: ?{[key: string]: mixed};
104103
errors?: Array<GraphQLError>;
104+
data?: ?{[key: string]: mixed};
105105
};
106106

107107
/**
@@ -166,7 +166,7 @@ export function execute(
166166
if (!context.errors.length) {
167167
return { data };
168168
}
169-
return { data, errors: context.errors };
169+
return { errors: context.errors, data };
170170
});
171171
}
172172

0 commit comments

Comments
 (0)