- Issue created by @abelass
- Status changed to Closed: works as designed
10 months ago 8:29am 24 January 2024 - 🇨🇭Switzerland ayalon
I don't think this is related to Drupal 10.2. I tested this on a fresh Drupal 10.2 installation.
The type and the bundle have to be explicitly enabled under "Enabled entity base fields":
Then you can query the type like that:
query MyQuery { entityQuery( entityType: NODE filter: {conditions: {field: "type", value: "page"}} ) { items { __typename ... on NodePage { id entityBundle entityTypeId } } } }
Result:
{ "data": { "entityQuery": { "items": [ { "__typename": "NodePage", "id": "1", "entityBundle": "page", "entityTypeId": "node" } ] } } }
- 🇪🇸Spain abelass
This is not exactly the same as
type {
name
}returned the label of the content type and not the machine name. "Article" and not "article" / "Page" and not "page"
Since 10.2 this is not available anymore and can't see how the fetch this info in 10.2.
- 🇨🇭Switzerland ayalon
You are right. I found the issue. I commited a fix into the dev version.
These fields have new types:
- required_label
- machine_name
https://www.drupal.org/project/drupal/issues/3341682 📌 New config schema data type: `required_label` Fixed
IF you want, you can try the DEV version until I make a new release.