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

LAYOUT_QUERY on root.tsx cannot return translated menu items from SFAPI #713

Closed
natalieoldroyd opened this issue Mar 22, 2023 · 2 comments
Closed

Comments

@natalieoldroyd
Copy link

What is the location of your example repository?

https://github.com/natalieoldroyd/c1-demo-hydrogen-h2

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2.0

What version of Remix are you using?

No response

Steps to Reproduce

Menu is not supported by the @incontext directive ATM - here’s the list of translatable resources so this query will never return the translated navigation menu items. Since this isn't support by the API unless that changes this query should probably not set the expectation that we can get translated resources in this way.

const LAYOUT_QUERY = `#graphql
  query layoutMenus(
    $language: LanguageCode
    $headerMenuHandle: String!
    $footerMenuHandle: String!
  ) @inContext(language: $language) {
    shop {
      id
      name
      description
    }
    headerMenu: menu(handle: $headerMenuHandle) {
      id
      items {
        ...MenuItem
        items {
          ...MenuItem
        }
      }
    }
    footerMenu: menu(handle: $footerMenuHandle) {
      id
      items {
        ...MenuItem
        items {
          ...MenuItem
        }
      }
    }
  }
  fragment MenuItem on MenuItem {
    id
    resourceId
    tags
    title
    type
    url
  }
`;

Expected Behavior

As of right now the expected behaviour is that we can't get translated menu items even if they are available via translate & adapt app.

Actual Behavior

Translate menu item resources are not returned by the api call.

@frehner
Copy link
Contributor

frehner commented Mar 22, 2023

Thanks for the feedback! This is a known issue, and is being tracked in this repo for the Storefront API: Shopify/storefront-api-feedback#156

@frehner frehner closed this as completed Mar 22, 2023
@frehner
Copy link
Contributor

frehner commented Mar 22, 2023

(Make sure to give that issue an upvote, as it hopefully signals to the Storefront API team how important it is by the number of upvotes it has received)

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

No branches or pull requests

2 participants