AndreasFaust / gatsby-source-custom-api

Source data from any API and transform it to (File-)Nodes.
52 stars 25 forks source link

unable to group by nest field #1

Closed tariqinaam closed 4 years ago

tariqinaam commented 5 years ago

Hi, I have data in json format with some nested field that I want to use for grouping the result. however I dont get any result if I group by nested field. e.g this query doesnt return any result. however if i group by date(which is not a nested field), it works. { allVideos { group(field:brand___name) { edges { node { id title } } } } }

videos: [ { title: "xyz", date: "2019-03-24", brand: { name: "documentaries", }, { title: "dddd", date: "2019-03-24", brand: { name: "documentaries", }, { title: "aaa", date: "2019-03-15", brand: { name: "comedy", } }] Is there anything happening on plugin that preventing it?. thanks

AndreasFaust commented 5 years ago

Admittedly I have not tried grouping by a nested field before. Maybe it has to be specially implemented in the node-relations somehow. I'll try it out and write you back. Please tell me, if you get it to work somehow (maybe with another source-plugin).

tariqinaam commented 5 years ago

thanks, will try. do you know any other plugin to get data from custom json schema

AndreasFaust commented 5 years ago

The most popular is gatsby-source-apiserver. https://www.npmjs.com/package/gatsby-source-apiserver

tariqinaam commented 5 years ago

The most popular is gatsby-source-apiserver. https://www.npmjs.com/package/gatsby-source-apiserver

nested grouping perfectly worked with this plugin. :-)