A Component Proposal #1410
Replies: 4 comments 4 replies
-
@thekip just writing here quickly to say that I love it. This needs to happen ASAP. I will report back with more but will mark it as |
Beta Was this translation helpful? Give feedback.
-
Just an update here - we're marking this as priority 1 on our roadmap and have a very good way to support this. With our Super easy way to support this feature without having to build additional config properties! |
Beta Was this translation helpful? Give feedback.
-
Is this the "preferred" method of getting "inheritance" out of Payload? It's very common for us to define what I would normally call a "base collection" and then ideally we'd inherit not just the fields, but the admin options from that base collection. |
Beta Was this translation helpful? Give feedback.
-
Hey @thekip I just opened a PR to address this request. Could you give it a look and let me know what you think? Much appreciated 👍 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to introduce a concept of a Components into Payload CMS.
This is effectively just a definition of Type in graphql or Class in Typescript.
Despite the fact we can benefit from dev-ops vs click-ops approach and extract some common fields of collection/global type into separate file and reuse it, this relation isn't reflected in GraphQL or Typescript types. Which make impossible to use some common approaches, especially in GraphQL.
Let me show this by examples:
This is how it is now:
The developers may want to create a common component on the page called
Meta
to consume this data:In GQL you can select fields only from one type, you cannot spread fragment on different types even if listed fields exist on both types. So i can use this component with it's fragment only on
Page
type and it's difficult to reuse it forCategory
Proposition:
Then you can query it using one component from different collections:
Basically, it's quite similar to blocks, but singular.
Thanks.
Related issues:
Beta Was this translation helpful? Give feedback.
All reactions