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.
FeatureStatusDescription
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.
FeatureCategoryDescription
@requires Directive SupportFederationField dependencies across services
Nested Key Entity LookupsFederationComplex nested key resolution
Cross-service Field DependenciesFederationAdvanced field dependency management
Lazy LoadingPerformanceLazy loading capabilities for better performance
GraphQL SubscriptionsReal-timeReal-time data subscriptions
Event-driven UpdatesReal-timeEvent-based data updates
Advanced gRPC ConfigurationConfigurationRetry policies and custom timeouts
Enhanced Scalar SupportType SystemImproved scalar type handling
Field Resolver CapabilitiesType SystemCustom field resolution support
Custom Type MappingsType SystemAdvanced type mapping features
Dynamic Scalar ConversionType SystemRuntime scalar conversion
JSON Scalar MappingsType SystemJSON-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
Example Warning: Using nullable list items like [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
Example Error: Using unsupported GraphQL features that have no protobuf equivalent.

Linting Output

When you run the generation command, you’ll see output similar to:
[!] Schema validation warnings:
 β”‚
 β”œβ”€β”€β”€β”€β”€β”€β”€β”€ file: /Users/ludwig/git/go/cosmo/demo/pkg/subgraphs/projects/src/schema.graphql
 β”œβ”€β”€β”€β”€ warnings: 14
 β”‚
 β”œβ”€ warn: Nullable items are not supported in list types: [Project] at line 13, column 45
 β”œβ”€ warn: Nullable items are not supported in list types: [String] at line 21, column 16
 β”œβ”€ warn: Nullable items are not supported in list types: [Project] at line 22, column 21
 β”œβ”€ warn: Nullable items are not supported in list types: [Task] at line 23, column 37
 β”œβ”€ warn: Nullable items are not supported in list types: [String] at line 98, column 9
 β”œβ”€ warn: Nullable items are not supported in list types: [Project] at line 99, column 24
 β”œβ”€ warn: Nullable items are not supported in list types: [Milestone] at line 103, column 21
 β”œβ”€ warn: Nullable items are not supported in list types: [Milestone] at line 119, column 17
 β”œβ”€ warn: Nullable items are not supported in list types: [Task] at line 120, column 13
 β”œβ”€ warn: Nullable items are not supported in list types: [String] at line 139, column 11
 └─ ...and more warnings...

[βœ•] Schema validation errors:
 β”‚
 β”œβ”€β”€β”€β”€β”€β”€β”€β”€ file: /Users/ludwig/git/go/cosmo/demo/pkg/subgraphs/projects/src/schema.graphql
 β”œβ”€β”€β”€β”€β”€β”€ errors: 1
 β”‚
 └─ error: Nested key directives are not supported yet at line 79, column 49
 β”‚
 └─ Generation stopped due to validation errors.

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

  1. Address errors first: Fix all linting errors before proceeding with development
  2. Review warnings carefully: Understand the implications of warnings for your use case
  3. Test thoroughly: When warnings are present, test the affected functionality carefully
  4. Stay updated: Check for updates to linting rules as the gRPC integration evolves

Common Linting Issues

IssueTypeDescriptionResolution
Nullable list items [String]!WarningNot directly supported in protobufConsider alternative patterns
Custom scalarsWarningLimited to fixed mappingsUse built-in scalars or string types
Union typesErrorNot supported in current integrationRefactor to use interfaces or separate types
Complex nested inputsWarningMay have performance implicationsConsider flattening input structures

Resources & Community

For questions, updates, and community support: See also: gRPC Services Β· Plugins