immanuelrosal
04/18/2018, 9:29 AMWaweru
04/18/2018, 10:43 AMtsdexter
04/18/2018, 12:32 PMtsdexter
04/18/2018, 12:34 PMtsdexter
04/18/2018, 12:36 PMcustomerData
) and loop through it in your app/frontend to use the individuals recordsWaweru
04/18/2018, 12:36 PM{
customers {
id
first_name
last_name
}
}
I get the following output:
{
"data": {
"customers": {
"id": null,
"first_name": null,
"last_name": null
}
}
}
tsdexter
04/18/2018, 12:38 PMtsdexter
04/18/2018, 12:38 PMtsdexter
04/18/2018, 12:39 PMconsole.log(customerData)
and post that?Waweru
04/18/2018, 12:40 PMWaweru
04/18/2018, 12:43 PMtsdexter
04/18/2018, 12:49 PMtsdexter
04/18/2018, 12:49 PMWaweru
04/18/2018, 12:52 PMtsdexter
04/18/2018, 12:57 PMcustomers
array (according to a comment here: https://jaketrent.com/post/return-array-graphql/)
customerData = await axios(`${BaseURL}/customers`)
.then(resp => resp.data);
return { customers: customerData };
tsdexter
04/18/2018, 12:58 PMconst
const customerData = await axios(`${BaseURL}/customers`)
.then(resp => resp.data);
return { customers: customerData };
Waweru
04/18/2018, 1:24 PMWaweru
04/18/2018, 1:24 PM${BaseURL}/customers
)
.then(resp => resp.data);
}
}immanuelrosal
04/18/2018, 1:25 PMWaweru
04/18/2018, 1:25 PMWaweru
04/18/2018, 1:26 PMtsdexter
04/18/2018, 1:43 PMGraphQLList
now from my first foray into graphql, building the actual server... haven't build one since as I've been using Graphcool which doesn't need a server... glad it's working!