-
Notifications
You must be signed in to change notification settings - Fork 72
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
Hygraph schema structure simplifications #1922
Comments
Also after this simplification we'd like to offer a declarative Hygraph schema so we can build libraries instead of keeping everything locally. |
Useless RowProduct entriesIn the above post we didn't mention the RowProduct model, which is a bit of an odd one, because it requires external data to be passed for the row to actually display something useful. The RowProduct used for a product are fairly empty as they only use the Non product misusagesAnd second it isn't really a component that only renders information about a product, because it is also used to render information about categories on the homepage ( Although this being the case, there currently is no way to define which category or product is used to render a RowProduct. The product page currently has a Possible solutionsCreate a RowReference model which allows you to create a reference to an external entity.
The actual data loading happens on the next.js side. Although Hygraph supports federated content, it can not do so transparently (it prefixes everything so all our fragments and code can't be used to query information that way). |
Rows are scoped to a single RowRendererCurrently we are limited in scope where to put Hygraph content: We have a defined RowRenderer in a single location and we are able to influence this location, but not other locations like:
It might be interesting to explore more size render sizes:
Proposed solution
|
|
Renamen Dynamic Row fields:
|
Describe the feature you'd like to request
We'd like to simplify the Hygraph schema by leveraging a 'Variant' system instead of separate models for rows. This is an extension of #1912
Describe the solution you'd like
#1912 (comment)
With the current introduction of the Hygraph schema migration system we can start assuming the Hygraph schema exists in a certain format. We can assume the Page and DynamicRow components exist, this means that queries do not need to be in the example directory, but can be moved to a hygraph-content package or something (for now we can re-use the old graphcms-ui package).
The goal of the hygraph-content package should be: Make sure the schema is locked for the current models except for specific project specific implementations.
Asset (alt field)
DynamicRow
Page
PageLink
RowColumnOne (to be renamed to RowText)
RowLinks
Footer (to be renamed to Settings)
Components:
AND
Number
OR
Text
Enums:
DynamicRowConditionNumberOperator
DynamicRowPlacement
MetaRobots
RowLinksVariants
RowProductVariants
And assume the following Row components are 'project specific' (need to be kept in the examples directory):
RowBlogContent (to be migrated to RowText)
RowButtonLinkList (already deprecated)
RowColumnThree (to be deprecated)
RowColumnTwo (to be deprecated)
RowContentLinks (already deprecated)
RowHeroBanner (to be deprecated, replace with a variant on RowLinks)
RowQuote (to be deprecated, replace with RowText with a blockquote)
RowServiceOptions (to be deprecated, replace with a variant on RowLinks)
RowSpecialBanner (to be deprecated??)
Usps (to be deprecated??, replace with RowLinks variant?)
This of course is a way bigger project than the current implementation here, but it sets the changes that need to be made before the next major release.
After this comment we've had further discussions to simplify this even more, if we'd add an Asset field to RowLinks we could use it for even more cases.
The text was updated successfully, but these errors were encountered: