Skip to content

Conversation

@melnikovi
Copy link
Member

@melnikovi melnikovi commented Oct 8, 2020

Problem

Allow to get content of dynamic blocks in PWA.

Solution

Requested Reviewers

@cpartica, @prabhuram93

type DynamicBlock {
uid: ID!
name: String!
content: String!
Copy link
Member Author

@melnikovi melnikovi Oct 8, 2020

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

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
}

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.

Copy link
Contributor

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

Copy link

@fnhipster fnhipster Nov 3, 2020

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!
Copy link

@supernova-at supernova-at Oct 22, 2020

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.

Copy link
Member Author

@melnikovi melnikovi Oct 22, 2020

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.

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>

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?

Copy link
Member Author

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.

@melnikovi melnikovi merged commit 211e8ab into magento:master Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants