Trying scaffold.io and found the simplest code to get the first customer is
const myQuery = gql`
{
viewer {
allCustomers(first: 1) {
edges { node { firstName } }
}
}
}client.query({ query: myQuery })
.then((graphQLResult) => {
console.log('success: ', graphQLResult.data.viewer.allCustomers.edges[0].node.firstName)
})
All this verbosity has a reason (for example to support paging), but the elegance hasn't hit me yet.