Overview
This page outlines the supported features and known limitations for the gRPC integration (both plugins and services) with the Cosmo Router. Development is in progress to expand support and address these limitations.Feature Support Overview
The following table lists each gRPC integration feature, its current status, and a brief description.Feature | Status | Description |
---|---|---|
Query Operations | β | Full support for all query patterns |
Mutation Operations | β | Complete mutation functionality |
Federation Entity Lookups (Single Key) | β | Standard entity resolution |
Federation Entity Lookups (Multiple Keys) | β | Multi-key entity resolution |
Federation Entity Lookups (Compound Keys) | β | Complex key combinations |
Federation Entity Lookups (Nested Keys) | β | Complex nested key resolution not yet supported |
@requires Directive | β | Field dependencies across services not implemented |
Scalar Arguments | β | All standard scalars supported |
Complex Input Types | β | Nested input structures |
Nullable Scalar Types | β | Optional fields supported |
Custom Scalar Conversion | β | Limited to fixed mappings only |
Enum Values | β | Bidirectional mapping support |
Interface Types | β | With implementing types |
Union Types | β | With member types |
Recursive Types | β | Self-referencing structures |
Nested Object Types | β | Complex relationships |
Lists | β | Nullable and non-nullable |
Nested Lists | β | Multi-dimensional arrays |
Complex List Structures | β | Lists of objects and interfaces |
Nullable List Items | β | Not supported due to Protobuf constraints |
Entity Definitions | β | Standard federation entities |
Key Directives | β | Single and compound keys |
External Fields | β | Cross-service field references |
Field Resolvers | β | Custom field resolution not available |
GraphQL Subscriptions | β | Real-time data subscriptions not yet supported |
π Roadmap
Development is in progress to address these limitations and expand gRPC integration capabilities, with the following features planned for future releases.Feature | Category | Description |
---|---|---|
@requires Directive Support | Federation | Field dependencies across services |
Nested Key Entity Lookups | Federation | Complex nested key resolution |
Cross-service Field Dependencies | Federation | Advanced field dependency management |
Lazy Loading | Performance | Lazy loading capabilities for better performance |
GraphQL Subscriptions | Real-time | Real-time data subscriptions |
Event-driven Updates | Real-time | Event-based data updates |
Advanced gRPC Configuration | Configuration | Retry policies and custom timeouts |
Enhanced Scalar Support | Type System | Improved scalar type handling |
Field Resolver Capabilities | Type System | Custom field resolution support |
Custom Type Mappings | Type System | Advanced type mapping features |
Dynamic Scalar Conversion | Type System | Runtime scalar conversion |
JSON Scalar Mappings | Type System | JSON-based scalar handling |
Schema Linting
When designing your GraphQL schema, you might encounter some of the limitations mentioned above. To ensure compatibility with the Cosmo Routerβs gRPC integration, we provide schema linting through protographic that validates your GraphQL schema against gRPC compatibility requirements.How Linting Works
The linting process analyzes your GraphQL schema and identifies potential compatibility issues with gRPC:- Warnings: Non-breaking issues that highlight features that may not work as expected
- Errors: Breaking issues that prevent successful gRPC integration and must be fixed
Warnings vs Errors
Warnings
Warnings allow the generation process to complete but inform you about potential limitations:- Process continues: The protobuf generation will finish successfully
- Feature limitations: Highlights GraphQL features that may not be fully supported in gRPC
- Non-breaking: Your plugin will still function, but certain features may behave differently
[String]!
will generate a warning since this pattern isnβt directly supported in protobuf.
Errors
Errors halt the generation process and require immediate attention:- Process stops: The protobuf generation will fail and must be resolved
- Breaking issues: Indicates schema patterns that cannot be translated to gRPC
- Must be fixed: You need to modify your schema before proceeding
Linting Output
When you run the generation command, youβll see output similar to:Feature Gates
Some linting rules are controlled by feature gates and may evolve over time:- Experimental features: Some rules may be relaxed as gRPC integration capabilities expand
- Backward compatibility: Existing linting behavior is maintained for stability
- Future improvements: Rules may be removed or modified as new features become available
Tip: Pay attention to warnings during development. While they donβt prevent your plugin from working, they help you understand which GraphQL features may have limitations in the gRPC context.
Best Practices
- Address errors first: Fix all linting errors before proceeding with development
- Review warnings carefully: Understand the implications of warnings for your use case
- Test thoroughly: When warnings are present, test the affected functionality carefully
- Stay updated: Check for updates to linting rules as the gRPC integration evolves
Common Linting Issues
Issue | Type | Description | Resolution |
---|---|---|---|
Nullable list items [String]! | Warning | Not directly supported in protobuf | Consider alternative patterns |
Custom scalars | Warning | Limited to fixed mappings | Use built-in scalars or string types |
Union types | Error | Not supported in current integration | Refactor to use interfaces or separate types |
Complex nested inputs | Warning | May have performance implications | Consider flattening input structures |
Resources & Community
For questions, updates, and community support:GitHub Repository
β View the repository for updates and issue tracking
Release Notes
π’ Latest feature updates and changes in each release
Discord Community
π¬ Get help and join discussions with the community
gRPC Concepts
π Learn about gRPC concepts and patterns