Skip to content
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

Querying a Draft containing a Neo field with nested blocks (level 4) using Craft's Graphiql playground returns an empty result when modified #908

Closed
nedu64 opened this issue Jul 8, 2024 · 4 comments

Comments

@nedu64
Copy link

nedu64 commented Jul 8, 2024

Bug Description

I currently have a Neo field which contains a few blocks used in adding various content to a page. Based on the Block configuration and the issue at hand, i noticed adding child blocks to an existing child block up to level 4 seems a bit problematic when querying its modified Drafts content as tested using Graphiql playground. Here is a bit of description of the block configuration:

  • Field name:Content Builder
  • Field type: Neo
  • Block Configuration
    • Content Row
      • Content Column (Child Block)
        • Accordion Item (Child Block)
          • Heading
          • Hidden Content (Child Block)
            • Buttons (Child Block)
            • Copy (Child Block)
            • Heading (Child Block)
            • Downloads Dropdown Buttons (Child Block)
            • Downloads Dropdown Block (Child Block)
            • ...

Pictorial Description

Screenshot 2024-07-08 at 10 30 15 Screenshot 2024-07-08 at 10 29 21 Screenshot 2024-07-08 at 09 54 01 Screenshot 2024-07-08 at 10 34 49

Adding content to any of the Hidden Content's Block works in Live Preview when saved. However if you create a Draft from the saved page and make any modifications to any of the Hidden Content's Child Blocks, Graphiql playground returns an empty response for the Child Blocks:
E.g:

Saved content below

Screenshot 2024-07-08 at 10 19 19

Query (Graphiql):

contentBuilder {
          ... on contentBuilder_contentRow_BlockType {
            children {
              ... on contentBuilder_contentColumn_BlockType {
                children {
                  ... on contentBuilder_accordion_BlockType {
                    heading
                    children {
                      ... on contentBuilder_richText_BlockType {
                        __typename
                        richText
                      }
                      ... on contentBuilder_pane_BlockType {
                        id
                        children {
                          ... on contentBuilder_richText_BlockType {
                            id
                            richText
                          }
                        }
                      }
                    }
                  }
                  ... on contentBuilder_richText_BlockType {
                    __typename
                    richText
                  }
                }
              }
            }
          }
        }

Response:

 {
      "heading": "Test heading",
      "children": [
        {
          "id": "1429731",
          "children": [
            {
              "id": "1786121",
              "richText": "<p>Saved content currently works</p>"
            }
          ]
        }
      ]
    },
  • Create a draft from the saved page
    • Add changes to the Accordion item block e.g:
Screenshot 2024-07-08 at 11 02 07 - Query the saved draft in graphiql playground - Query
drafts {
      id
      title
      ... on pages_builder_Entry {
        contentBuilder {
          ... on contentBuilder_contentRow_BlockType {
            children {
              ... on contentBuilder_contentColumn_BlockType {
                children {
                  ... on contentBuilder_accordion_BlockType {
                    heading
                    children {
                      ... on contentBuilder_richText_BlockType {
                        __typename
                        richText
                      }
                      ... on contentBuilder_pane_BlockType {
                        id
                        children {
                          ... on contentBuilder_richText_BlockType {
                            id
                            richText
                          }
                        }
                      }
                    }
                  }
                  ... on contentBuilder_richText_BlockType {
                    __typename
                    richText
                  }
                }
              }
            }
          }
        }
      }
    }

Response:

{
  "heading": "Test heading",
  "children": []
},

Steps to reproduce

  1. Create a test page in craft
  2. Add a Neo field
  3. Model your Neo field based on the example shared in the Bug Description section
    • Field name: Content Builder
    • Field type: Neo
    • Block Configuration
      • Content Row
        • Content Column (Child Block)
          • Accordion Item (Child Block)
            • Heading
            • Hidden Content (Child Block)
              • Buttons (Child Block)
              • Copy (Child Block)
              • Heading (Child Block)
              • Downloads Dropdown Buttons (Child Block)
              • Downloads Dropdown Block (Child Block)
  4. Add contents to the (Level 4) nested block (Hidden Content)
  5. Confirm that you can query your saved content using Graphiql Playground
  6. Create a draft from your saved page containing modelled Neo field
  7. Add modifications to the (Level 4) nested block (Hidden Content)
  8. Try querying Graphiql Playground again for the changes added to your saved drafts
  9. Note that all child blocks of the Hidden Content (Level 4) Block are missing

Expected behaviour

Adding changes to a nested block up to Level 4 in a created Draft, i'm able to see these changes when querying using Craft's Graphiql Playground

Neo version

4.1.2

Craft CMS version

Craft Pro 4.9.5

What is the affected Neo field's propagation method?

No response

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

@nedu64 nedu64 changed the title Querying a Drafts Neo field nested blocks (level 4) using Graphiql playground returns an empty result when modified Querying a Draft containing a Neo field with nested blocks (level 4) using Graphiql playground returns an empty result when modified Jul 8, 2024
@nedu64 nedu64 changed the title Querying a Draft containing a Neo field with nested blocks (level 4) using Graphiql playground returns an empty result when modified Querying a Draft containing a Neo field with nested blocks (level 4) using Craft's Graphiql playground returns an empty result when modified Jul 8, 2024
@ttempleton
Copy link
Contributor

If possible, could you please send your composer.json/lock files and database backup to [email protected], along with directions to an entry where this reliably happens, and we'll have a look.

@ttempleton ttempleton added bug report status: unconfirmed A bug report that has not yet been reproduced by the maintainer(s), and more information is required and removed bug report status: new labels Jul 9, 2024
@johnnynotsolucky
Copy link

Thanks for looking into this @ttempleton. We won't be able to send a copy of the database for the install that we're seeing this issue on. However, we're going to test with version 4.2.7 of Neo, and if the issue we're seeing is still present, we'll set up a fresh Craft install and try and reproduce it - we would then be able to send you a copy of that DB.

@nedu64
Copy link
Author

nedu64 commented Jul 14, 2024

If possible, could you please send your composer.json/lock files and database backup to [email protected], along with directions to an entry where this reliably happens, and we'll have a look.

@ttempleton Done, also note that the issue is also reproducible in version 4.2.8

@ttempleton ttempleton added bug report status: confirmed A bug report that has been reproduced by the maintainer(s), but has not yet been fixed and removed bug report status: unconfirmed A bug report that has not yet been reproduced by the maintainer(s), and more information is required labels Jul 17, 2024
ttempleton added a commit that referenced this issue Jul 25, 2024
@ttempleton
Copy link
Contributor

Thanks for that @nedu64 - fixed now in 4.2.9.

@ttempleton ttempleton added bug report status: fixed and removed bug report status: confirmed A bug report that has been reproduced by the maintainer(s), but has not yet been fixed labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants