Skip to content

Commit 7287c7c

Browse files
authored
Merge pull request #838 from APIs-guru/fieldsOrder
Make 'errors' top property in the response object.
2 parents 5fee9b5 + 7d00990 commit 7287c7c

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
@@ -93,12 +93,12 @@ type ExecutionContext = {
9393
/**
9494
* The result of GraphQL execution.
9595
*
96-
* - `data` is the result of a successful execution of the query.
9796
* - `errors` is included when any errors occurred as a non-empty array.
97+
* - `data` is the result of a successful execution of the query.
9898
*/
9999
export type ExecutionResult = {
100-
data?: ?{[key: string]: mixed};
101100
errors?: Array<GraphQLError>;
101+
data?: ?{[key: string]: mixed};
102102
};
103103

104104
/**
@@ -163,7 +163,7 @@ export function execute(
163163
if (!context.errors.length) {
164164
return { data };
165165
}
166-
return { data, errors: context.errors };
166+
return { errors: context.errors, data };
167167
});
168168
}
169169

0 commit comments

Comments
 (0)