umbraco-community / umbraco-graphql

An implementation of GraphQL for Umbraco 8 using GraphQL for .NET.
MIT License
64 stars 32 forks source link

Multi-lingual content and variants #64

Open mzajkowski opened 3 years ago

mzajkowski commented 3 years ago

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

artcups commented 3 years ago

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