Added code field on the country resolver

This commit is contained in:
Serkan Olgun
2019-09-26 16:25:35 +02:00
parent a7b26004c9
commit 9dab5526cc

View File

@@ -42,7 +42,11 @@ export default {
})); }));
}, },
country(parent, {code}) { country(parent, {code}) {
return countries[code]; const country = countries[code];
return {
...country,
code
};
}, },
countries() { countries() {
return Object.entries(countries).map(([code, country]) => ({ return Object.entries(countries).map(([code, country]) => ({