umbraco / Umbraco.Heartcore.Issues

3 stars 1 forks source link

GrapgQL query content by parent id #108

Closed wvankesteren-ax closed 10 months ago

wvankesteren-ax commented 1 year ago

Issue description

Derived from https://support.umbraco.com/hc/en-us/requests/84523

We want to be able to query for content nodes based upon it's parent id.

e.g. A document type, 'fragment', can be created under a 'Widgets' or a 'Widgets Templates' parent (both of document type 'widget').

We want to have a simple GraphQL query (hence a simple result) to only get the fragments under the 'Widgets Templates' parent.

However an error occurs.

Can this be implemented?

Query:

`query ListAllNewsTemplates { allFragment( where: { parent: { id: "9ef4c0cd-6ef1-4a68-9ca8-64802a558e82" } } ) { items { id name url createDate updateDate

  title
}

} }`

Error:

{ "errors": [ { "message": "Argument 'where' has invalid value. In field 'parent': Unknown field.", "locations": [ { "line": 2, "column": 15 } ] } ] }

jmf-umbraco commented 10 months ago

Hi @wvankesteren-ax, thanks very much for your suggestion!

We are happy to inform you that this is something that we have started working on now and should have ready for use in the next week or two!

rasmusjp commented 10 months ago

Hi @wvankesteren-ax

parent is now available as a filtering option

wvankesteren-ax commented 10 months ago

many thanx!