|
|
|
|
|
by WhitneyLand
3406 days ago
|
|
Great project. I'm still deciding how much like gql itself. 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. |
|
Edges and node is also a Relay interface.
Graphql can be simpler if you don't use relay. Also the relay client is quite fat.
I use Apollo and I do use relay interface and conventions, just without the official Relay client. I like Apollo's simplicity a lot more.