Estoy tratando de implementar GraphQL, pero siempre aparece el error Iterable esperado. Según tengo entendido puede haber un error con los tipos, pero probé de todo y no se que hacer
eso es lo que devuelve mi API
{ "data": [ { "id": "bitcoin", "rank": "1", "symbol": "BTC", "name": "Bitcoin", "supply": "17193925.0000000000000000", "maxSupply": "21000000.0000000000000000", "marketCapUsd": "119150835874.4699281625807300", "volumeUsd24Hr": "2927959461.1750323310959460", "priceUsd": "6929.8217756835584756", "changePercent24Hr": "-0.8101417214350335", "vwap24Hr": "7175.0663247679233209" }, ...... ] }y aquí está mi código
const coinType = new GraphQLObjectType({ name: 'Coin', fields: () => ({ id: { type: GraphQLString }, name: { type: GraphQLString }, }) }); // Root Query const RootQuery = new GraphQLObjectType({ name: 'RootQueryType', fields: () => ({ coin: { type: new GraphQLList(launchType), resolve(parent, args) { return axios .get('https://api.coincap.io/v2/assets') .then(res => res.data); } }, }) }); module.exports = new GraphQLSchema({ query: RootQuery });