I have a multiple fieldsets that have a Bard element with the handle "text". These Bards have different configurations (one has sets, the other one does not). The issue is that gqlSetsTypeName() returns the bards having the same name (Sets_Text), which causes an issue when querying subsets in Graphql: Undefined array key "set handle" because it looks in the first version it got.
My first Idea would be to add the Fieldset handle to the name as well, however, I do not know how or if this would be appropriate.
How to reproduce
Fieldset A
Bard: Text
Fieldset B
Bard: Text
Fieldset C
Bard: Text
Set: Fieldset B
When calling gqlSetsTypeName() on each I Get Sets_Text, even though fieldset C has a different configuration. The set configuration does not have a handle, however, adding one doesn't seem to help.
query Test {
entry(uri: "/test") {
... on Entry_Pages_Page {
id
components {
... on Set_Components_Text {
text {
<-- here I should be able to "... on FieldsetC Subset"
but GQL thinks this is the first Version of Bard text and therefor does not have subsets
... on BardText {
type
}
}
}
}
}
}
}
renaming one of the "text" to e.g. "content" solves the issue, however, I don't think this is a good solution.
Logs
Undefined array key "test"
Illuminate\Foundation\Bootstrap\HandleExceptions:handleError
public function types(): array
{
return $this->types;
}
public function resolveType($value)
{
return GraphQL::type($this->typeMap[$value['type']]);
}
Illuminate\Foundation\Bootstrap\HandleExceptions:Illuminate\Foundation\Bootstrap\{closure}
Statamic\GraphQL\Types\ReplicatorSetsType:resolveType
Statamic\GraphQL\Types\BardSetsType:resolveType
GraphQL\Executor\ReferenceExecutor:completeAbstractValue
GraphQL\Executor\ReferenceExecutor:completeValue
GraphQL\Executor\ReferenceExecutor:completeValueCatchingError
GraphQL\Executor\ReferenceExecutor:completeListValue
GraphQL\Executor\ReferenceExecutor:completeValue
...
Bug description
I have a multiple fieldsets that have a Bard element with the handle "text". These Bards have different configurations (one has sets, the other one does not). The issue is that
gqlSetsTypeName()
returns the bards having the same name (Sets_Text
), which causes an issue when querying subsets in Graphql:Undefined array key "set handle"
because it looks in the first version it got.My first Idea would be to add the Fieldset handle to the name as well, however, I do not know how or if this would be appropriate.
How to reproduce
Fieldset A
When calling
gqlSetsTypeName()
on each I GetSets_Text
, even though fieldset C has a different configuration. The set configuration does not have a handle, however, adding one doesn't seem to help.renaming one of the "text" to e.g. "content" solves the issue, however, I don't think this is a good solution.
Logs
Environment
Installation
Existing Laravel app
Antlers Parser
None
Additional details
No response