drupal-entity-api

Load, query, and modify Drupal entities using entity type manager.

67|13|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/edutrul/drupal-ai --skill drupal-entity-api-edutrul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-entity-api
Source: https://github.com/edutrul/drupal-ai/tree/main/.claude/skills/drupal-entity-api
Command: npx skills add https://github.com/edutrul/drupal-ai --skill drupal-entity-api-edutrul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Programmatic entity management in Drupal—loading, querying, creating, updating, and deleting entities across node, user, taxonomy term, and media types.

Core Features & Use Cases

  • Load entities by ID, by properties, or in batches.
  • Create, update, or delete nodes, users, terms, and media with field data.
  • Run entity queries with conditions, sorting, ranges, and access checks.
  • Inject and use EntityTypeManagerInterface to drive entity storage operations in services or controllers.

Quick Start

Inject EntityTypeManagerInterface into your service and begin loading, creating, or updating entities as shown in the usage examples.

Frequently Asked Questions about drupal-entity-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I load and query Drupal entities programmatically in a module?

To load and query Drupal entities programmatically, you inject the EntityTypeManagerInterface into your service, use getStorage to load entities by ID or in batches, and apply entity queries with conditions and sorting to retrieve matching data.

What is the proper way to create and update nodes, users, and taxonomy terms in Drupal?

Creating and updating nodes, users, and taxonomy terms in Drupal requires using EntityTypeManagerInterface to get the storage controller, populating the entity object with field data, and calling the save method to persist changes across multiple entity types.

Can I run entity queries with access checks and sorting in Drupal module development?

Yes, you can run entity queries with access checks and sorting in Drupal module development by using the getQuery method through the entity type manager to apply conditions, ranges, and sorting while respecting proper access restrictions.

Does this approach to entity management work for migrations and custom tooling across multiple entity types?

Yes, this entity management approach works for migrations and custom tooling across multiple entity types by using EntityTypeManagerInterface to drive storage operations, supporting lifecycle operations for nodes, users, taxonomy terms, and media.

What's the best way to delete media entities and other content types in Drupal programmatically?

The best way to delete media entities and other content types programmatically in Drupal is to load the target entities via getStorage and call the delete method on them, ensuring proper access checks are applied during the entity lifecycle operation.