@payloadcms/plugin-form-builder
Advanced tools
Changelog
1.2.0 (2022-11-18)
You might need to update your config. This change affects collections
, globals
and block fields
with custom labeling.
Collections: are affected if you have a custom labels.singular
defined that differs from your collection slug.
// ExampleCollection.ts
// Before
const ExampleCollection: CollectionConfig = {
slug: 'case-studies',
labels: {
// Before Payload used `labels.singular` to generate types/graphQL schema
singular: 'Project',
plural: 'Projects',
},
}
// After
const ExampleCollection: CollectionConfig = {
// Now Payload uses `slug` to generate types/graphQL schema
slug: 'case-studies',
labels: {
singular: 'Project',
plural: 'Projects',
},
// To override the usage of slug in graphQL schema generation
graphQL: {
singularName: 'Project',
pluralName: 'Projects',
},
// To override the usage of slug in type file generation
typescript: {
interface: 'Project',
},
}
Globals: are affected if you have a label
defined that differs from your global slug.
// ExampleGlobal.ts
// Before
const ExampleGlobal: GlobalConfig = {
slug: 'footer',
// Before Payload used `label` to generate types/graphQL schema
label: 'Page Footer',
}
// After
const ExampleGlobal: GlobalConfig = {
// Now Payload uses `slug` to generate types/graphQL schema
slug: 'footer',
label: 'Page Footer',
// To override the usage of slug in graphQL schema generation
graphQL: {
name: 'PageFooter',
},
// To override the usage of slug in type file generation
typescript: {
interface: 'PageFooter',
},
}
Block Fields: are affected if you have a label
defined that differs from your block slug.
// ExampleBlock.ts
// Before
const ExampleBlock: Block = {
slug: 'content',
// Before Payload used `label` to generate graphQL schema
label: 'Content Block',
}
// After
const ExampleBlock: Block = {
// Now Payload uses `slug` to generate graphQL schema
slug: 'content',
label: 'Content Block',
// To override the usage of slug in graphQL schema generation
graphQL: {
singularName: 'ContentBlock',
},
}
```
**Breaking changes recap**:
On Collections
graphQL.singularName
, graphQL.pluralName
for GraphQL schema names.typescript.interface
for typescript generation name.On Globals
graphQL.name
for GraphQL Schema name.typescript.interface
for typescript generation name.On Blocks (within Block fields)
graphQL.singularName
for graphQL schema names.Changelog
1.1.0 (2022-09-13)