-
-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL schema for multiple collections with Bard+Sets is invalid #5211
Comments
The types get created as 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 |
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
The text was updated successfully, but these errors were encountered: