umbraco-graphql icon indicating copy to clipboard operation
umbraco-graphql copied to clipboard

Multi-lingual content and variants

Open mzajkowski opened this issue 4 years ago • 1 comments

Validate the queries against the new varianted content + rich properties like Nested Content under variants.

mzajkowski avatar Feb 09 '21 15:02 mzajkowski

Should this be working in the develop branch? I am trying to get all documents by type with items to build the site in Gatsby but it returns only empty fields. The document type and fields allows variants and the domain is configured

{
  umbraco {
    content {
      byType {
        home {
          items {
            _name
            _url
            heroHeader
          }
        }
      }
    }
  }
}

Result:

{
  "data": {
    "umbraco": {
      "content": {
        "byType": {
          "home": {
            "items": [
              {
                "_name": "Home",
                "_url": "/en/",
                "heroHeader": "Umbraco Demo"
              }
            ]
          }
        }
      }
    }
  },
  "extensions": {}
}

Culture query

{
  umbraco {
    content {
      byType {
        home(culture: "sv-SE") {
          items {
            _name
            _url
            heroHeader
          }
        }
      }
    }
  }
}
{
  umbraco {
    content {
      byType {
        home(culture: "sv") {
          items {
            _name
            _url
            heroHeader
          }
        }
      }
    }
  }
}

Result:

{
  "data": {
    "umbraco": {
      "content": {
        "byType": {
          "home": {
            "items": []
          }
        }
      }
    }
  },
  "extensions": {}
}

image

artcups avatar Feb 11 '21 10:02 artcups