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

fix: Take collection pages into account on slugifyRoot function #1429

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

victorhmp
Copy link
Member

@victorhmp victorhmp commented Aug 2, 2022

What's the purpose of this pull request?

This PR aims to solve issues users were facing trying to fetch the field StoreCollection.breadcrumbList for collection pages.

How it works?

Adds a new check for collection pages in the step that precedes the requests we make to figure out the pagetype for a certain route, inside the breadcrumbList field resolver.

How to test it?

Using the same test case from https://community.vtex.com/t/problemas-nas-rotas-de-collection-clusters/33353/4.

  • Clone this branch locally;
  • Update the account found at src/packages/api/local/index.ts to homologappoffpremium;
  • Run yarn develop inside src/packages/api;
  • Run the following query:
{
  collection(slug: "novidades-feminino") {
    slug
    seo {
      title
      description
    }
    meta {
      selectedFacets {
        key
        value
      }
    }
    breadcrumbList {
      itemListElement {
        name
        item
        position
      }
      numberOfItems
    }
    id
    type
  }
}

and you should get no errors :).

Starters Deploy Preview

References

@vercel
Copy link

vercel bot commented Aug 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
faststore ✅ Ready (Inspect) Visit Preview Sep 2, 2022 at 7:34PM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 2, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 002c80b:

Sandbox Source
Store UI Typescript Configuration

@victorhmp victorhmp self-assigned this Aug 2, 2022
@victorhmp victorhmp marked this pull request as ready for review August 2, 2022 20:47
@victorhmp victorhmp requested a review from a team as a code owner August 2, 2022 20:47
@victorhmp victorhmp changed the title Take collection pages into account on slugifyRoot function fix: Take collection pages into account on slugifyRoot function Aug 2, 2022
Copy link
Contributor

@filipewl filipewl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working!

CleanShot 2022-08-02 at 18 28 52

@victorhmp victorhmp merged commit 6e6b27b into main Aug 3, 2022
@victorhmp victorhmp deleted the fix/breadcrumbList-for-collections branch August 3, 2022 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants