ProcessGraphQL
ProcessGraphQL copied to clipboard
FieldtypeOptions only prints one Option
Hey, today I stumbled over a problem with the GraphQl-Module. We are using ProcessWire 3.0.200 and the GrqphQl-Module 1.3.0.
starting point
We use a "Select Options"-field on a page with the template "highlight". When we print the first page out of this array, all the options of the Field are printed by the API, see below.
Query first Page
{
highlight {
__typename
first {
__typename
tags_1_output {
__typename
title
}
}
}
}
Response first Page
{
"data": {
"highlight": {
"__typename": "HighlightPageArray",
"first": {
"__typename": "HighlightPage",
"tags_1_output": [
{
"__typename": "FieldtypeOptions",
"title": "Projects"
},
{
"__typename": "FieldtypeOptions",
"title": "Engagements"
},
{
"__typename": "FieldtypeOptions",
"title": "Publications"
},
{
"__typename": "FieldtypeOptions",
"title": "Workshops"
}
]
}
}
}
}
Problem
On the other hand, if we query the whole list of the pageArray, we only get the first options of the Options-Field. See Below.
Query all Pages
{
highlight {
__typename
list {
__typename
tags_1_output {
__typename
title
}
}
}
}
Response all Pages
{
"data": {
"highlight": {
"__typename": "HighlightPageArray",
"list": [
{
"__typename": "HighlightPage",
"tags_1_output": [
{
"__typename": "FieldtypeOptions",
"title": "Projects"
}
]
},
{
"__typename": "HighlightPage",
"tags_1_output": [
{
"__typename": "FieldtypeOptions",
"title": "Workshops"
}
]
},
{
"__typename": "HighlightPage",
"tags_1_output": [
{
"__typename": "FieldtypeOptions",
"title": "Workshops"
}
]
},
{
"__typename": "HighlightPage",
"tags_1_output": [
{
"__typename": "FieldtypeOptions",
"title": "Projects"
}
]
}
]
}
}
}
Is this a Bug or is there a simple solution I don't get. Help would be very appreciated.
Jonas
Thanks for reporting this @jonasvonarb. I was able to track the issue down to FieldtypeOptions
core module of ProcessWire.
I opened an issue there and also a proposed solution.
Once that issue is resolved then I'll update here if the issue is resolved and you can confirm then.
Update: This is fixed at processwire/processwire. Next release of ProcessWire should resolve the issue.