amin mohammadi
amin mohammadi

Reputation: 1053

Orchard core GraphiQL does not display my added field

I started my project on Orchard Core Cms with .NET 6. When I try to execute graphql query on GraphiQL tool on Orchard Core it does not display the field "description" which I added to the fields of ProductCategory content item The query is like below:

query MyQuery {
  productCategory {
    id
    description
    bag {
      contentItems {
        ... on ProductCategory {
          description
          bag {
            contentItems {
              ... on ProductCategory {
                id
                description
                displayText
              }
            }
          }
        }
      }
    }
  }
}

And the response is as follow:

{
  "data": {
    "productCategory": [
      {
        "id": 1,
        "description": "Product Category 1 Description",
        "bag": {
          "contentItems": [
            {
              "bag": {
                "contentItems": [
                  {
                    "id": 15,
                    // description field is absent
                    "displayText": "Product Category 3"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

ProductCategory content type has two fields: Id and Description and enjoys Title, Flow, Bag, Alias parts. Moreover, this content type can be bag of ProductCategory content type. As it visible in the code, the first item displays the description field but the child item ignores it

Upvotes: 0

Views: 210

Answers (1)

amin mohammadi
amin mohammadi

Reputation: 1053

I just needed to enable Autoroute feature and now everything works like a charm

Upvotes: 0

Related Questions