-
Notifications
You must be signed in to change notification settings - Fork 150
GraphQL schema for dynamic blocks #451
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 dynamic blocks #451
Conversation
| type DynamicBlock { | ||
| uid: ID! | ||
| name: String! | ||
| content: String! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can make it ComplexTextValue, that would allow to return content as a JSON in the future.
| type: DynamicBlockTypeEnum! | ||
| locations: [DynamicBlockLocationEnum!] # Blocks for all locations will be displayed if not supplied | ||
| rotation_mode: DynamicBlockRotationModeEnum! | ||
| dynamic_block_uids: [Int!] # Only makes sense when DynamicBlockTypeEnum is set to SPECIFIED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should dynamic_block_uids be an array of ID types?
type DynamicBlock {
uid: ID!
| FOOTER | ||
| LEFT | ||
| RIGHT | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the kind of stuff I'd love to get ahead of in the future and design "Venia First". I'm unsure where we'd put a Dynamic Block that specified a LEFT or RIGHT location; it doesn't really fit.
No worries for now though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@supernova-at it really comes to the question: is layout part of graphql or not.
since we have these zone is in Magento, relevant for Luma so far. Does it make sense to keep them for graphql.
Igor said yes, and I also got a request from @fnhipster to bring back the column layout on product interface. We took that one out completely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what "Venia First" means but we need to cover data that might not be part of Venia but needed for other storefronts. Layout is a good example. It's not utilized in Venia (yet) but we use it to enable authors/admins to have multiple layouts. The question I have is, are Location part of the Luma Theme or Core?
| type DynamicBlocksFilterInput { | ||
| type: DynamicBlockTypeEnum! | ||
| locations: [DynamicBlockLocationEnum!] # Blocks for all locations will be displayed if not supplied | ||
| rotation_mode: DynamicBlockRotationModeEnum! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is rotation_mode required?
I don't think the PWA will know this when it is querying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting allows to request one random dynamic block, multiple dynamic block to display all at once, etc. rotation_mode comes from the data-rotate attribute on the dynamic block node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right - ok, thanks!
| </li> | ||
| <!-- /ko --> | ||
| </ul> | ||
| </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this HTML come from originally? Who / what query sends this to the front end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This markup is in CMS blocks and pages content.
Problem
Allow to get content of dynamic blocks in PWA.
Solution
Requested Reviewers
@cpartica, @prabhuram93