Repository navigation
Change default field names in Form Builder plugin to avoid naming conflicts #15595
MurzNN
started this conversation in
Feature Requests & Ideas
Replies: 2 comments 1 reply
|
And, if we have the same issue with too generic naming of the types in other plugins too, would be great to make the more specific names there too. |
0 replies
|
I totally get where you're coming from but this would be a breaking change, quite a severe one at that, so it's only something we may be able to do in v4 and as such I've marked it as a request |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the Bug
If I add the Form Builder Plugin to a Payload project that uses collections with some popular names like Countries, States, Texts, Messages, etc, it starts to throw an error when building the GraphQL schema like this:
I spent hours on debugging to find the real source of this error, and the reason was the Form Builder Plugin!
This issue is even mentioned in the documentation https://payloadcms.com/docs/plugins/form-builder#preventing-generated-schema-naming-conflicts even with a suggested workaround!
But how many developers do actually read the documentation, right? 😜
So, instead of suggesting a workaround, I think it's a good idea to fix the source of the issue, and name the Form Builder Plugin block types with the appropriate suffix by default:
country»countryFormFieldetc.
This renaming should also make the name of the GraphQL type clearer and self-describable.
P.S. Here is the list of all "restricted" collection names:
Link to the code that reproduces this issue
https://github.com/Murz-forks/pl-fb-issue-1
Reproduction Steps
Textscollection to the project.Which area(s) are affected?
plugin: form-builder
Environment Info
All reactions