syncable-entity-integration

Integrate syncable entity services and resolvers into NestJS modules for Twenty entities.

54.6k|8.4k|Updated Dec 1, 2022
One-click install
npx skills add https://github.com/twentyhq/twenty --skill syncable-entity-integration-twentyhq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: syncable-entity-integration
Source: https://github.com/twentyhq/twenty/tree/main/.cursor/skills/syncable-entity-integration
Command: npx skills add https://github.com/twentyhq/twenty --skill syncable-entity-integration-twentyhq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the integration of syncable entities within a NestJS application by setting up the necessary service and resolver layers, ensuring proper data flow and exception handling.

Core Features & Use Cases

  • NestJS Module Registration: Wires syncable entity services into builder, validator, and action handler modules.
  • Service Layer Creation: Develops a service layer that handles business logic and returns flat entities.
  • Resolver Layer Creation: Builds a resolver layer to convert flat entities into DTOs for the GraphQL API.
  • Exception Handling: Integrates an exception interceptor for consistent API error responses.
  • Use Case: When developing a new feature that requires managing custom objects (e.g., "Projects", "Tasks") in Twenty, this Skill provides the foundational structure for their CRUD operations within the backend.

Quick Start

Register the MyEntityService and MyEntityResolver within their respective NestJS modules and utility files.

Frequently Asked Questions about syncable-entity-integration

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

FAQPage Schema
How do I integrate syncable entities into a NestJS backend?

Integrating syncable entities into a NestJS backend requires registering custom services and resolvers within their respective modules. This setup creates a service layer for flat entities and a resolver layer to convert them into DTOs for GraphQL API exposure.

How does a NestJS resolver layer convert flat entities to GraphQL DTOs?

A NestJS resolver layer converts flat entities to GraphQL DTOs by mapping the business logic output from the service layer. This ensures the GraphQL API receives properly structured data transfer objects instead of raw entity formats.

What's the best way to handle GraphQL API errors in a NestJS service layer?

Handling GraphQL API errors in a NestJS service layer is best achieved by integrating an exception interceptor. This provides consistent API error responses across all syncable entity operations.

When do I need a service layer for custom entity management in Twenty?

You need a service layer for custom entity management in Twenty when developing new features that require managing custom objects like Projects or Tasks. It provides the foundational structure for their CRUD operations within the backend.

Can I wire syncable entity services into NestJS builder and validator modules?

Yes, you can wire syncable entity services into NestJS builder, validator, and action handler modules. This module registration orchestrates the necessary data flow and exception handling for Twenty entities.

Does NestJS support flat entity structures for syncable entity data integration?

NestJS supports flat entity structures for syncable entity data integration by utilizing a dedicated service layer. This layer handles the business logic and returns flat entities before the resolver layer converts them to DTOs.