Closed Neobii closed 4 years ago
A simple example should be helpful, like this:
marketPairs: { label: "Market Pairs", type: String, hidden: true, optional: true, canRead: ['guests','members','admin'], resolveAs: { fieldName: 'marketPairs', type: '[MarketPair]', relation: 'hasMany', resolver: (coin, args, context) => { //change to graphql query later let res = context.MarketPairs.find({left: coin.exchangeSymbol}, {sort: {volume24: -1}, limit: 1}); //find latest aggregate return res; } } },
A simple example should be helpful, like this: