Skip to content

Commit 46254f5

Browse files
stschwarkbboure
authored andcommitted
Match the HTTP resolver result format (#7)
1 parent 85830a8 commit 46254f5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/data-loaders/HttpDataLoader.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default class HttpDataLoader {
77

88
async load(req) {
99
try {
10-
const { data } = await axios.request({
10+
const { data, status, headers } = await axios.request({
1111
baseURL: this.config.endpoint,
1212
url: req.resourcePath,
1313
headers: req.params.headers,
@@ -16,7 +16,11 @@ export default class HttpDataLoader {
1616
data: req.params.body,
1717
});
1818

19-
return data;
19+
return {
20+
headers,
21+
statusCode: status,
22+
body: JSON.stringify(data)
23+
}
2024
} catch (err) {
2125
console.log(err);
2226
}

0 commit comments

Comments
 (0)