I created a simple GraphQL query to test it out:

query FooterQuery($datasource: String!, $contextItem: String!) {

  datasource(value: $datasource) {
    id
    name
  }

  testItem: item(path: "/sitecore/content/Website/Home") {
    id
    name
  }

  contextItem: item(path: $contextItem) {
    id
    name
  }
}

This works great in ConnectedMode using GraphQLData:

export default GraphQLData(FooterQuery, { name: "footerQuery" })(Footer);

However, when I deploy files to my Sitecore solution (Integrated Mode), testItem and contextItem is null, and I can't figure out why..

  • Have you set the graphQLEndpoint on your JSS app configuration? That's necessary to inform it what GraphQL endpoint to run your query against. – Kam Figy Nov 28 at 19:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.