Open dmgawel opened 2 years ago
The types get created as Set_BardFieldHandle_SetFieldHandle
.
Looks to me like you get only the sets for the first field Bard that Statamic encounters, if they're named the same.
A workaround for now is to name your fields differently across collections.
Thanks @jasonvarga 🙇♂️ I've renamed a Bard field in a second collection to content2
and schema generation works again. That will do as a workaround, I'll leave the issue open for a more generic solution (that will allow us to give a content
name to all Bard fields across collections).
Hey, any chance to fix it anytime soon? We are using the workaround from @jasonvarga comment, but sometimes it's easy to forget about it ;-)
still same problem, we use block content system for all collections, so its very strange to have different field name for this
ps this issue not only for bard, we use replicator field
I would like to have a go at fixing this, but I need your help on how to approach it.
Presumably just adding the blueprint's handle to the type is not the way to go as this would not solve the issue for nested bards/replicators and it would be a breaking change.
Do you have any idea how you would like this to be solved?
An idea for a potential solution. Maybe we can have a config setting on the field that lets you give a custom GraphQL handle to the field to make it more unique across collections.
Bug description
When there is more than one collection that has a Bard field with Sets, the generated GraphQL schema is invalid. List of possible Sets from one of the Bard fields is used for all other collections.
How to reproduce
content
to both of them.content
field for both collections and add sample fields (can be text type) inside setscontent
field on bothEntry_Aaa_Aaa
andEntry_Bbb_Bbb
. You'll see that sets forEntry_Bbb_Bbb
are used forEntry_Aaa_Aaa
as well (could be the other way, I'm not sure what the rule is here, but looks like it's alphabetical).Logs
No response
Versions
Statamic 3.2.32 Pro Laravel 8.82.0 PHP 8.0.15 No addons installed
Installation
Fresh statamic/statamic site via CLI
Additional details
No response