Skip to content

fix: allow creation of event driven subgraphs#18

Merged
Noroth merged 3 commits into
mainfrom
ludwig/eng-7507-configuration-errors-with-edg-subgraph-in-terraform
Aug 20, 2025
Merged

fix: allow creation of event driven subgraphs#18
Noroth merged 3 commits into
mainfrom
ludwig/eng-7507-configuration-errors-with-edg-subgraph-in-terraform

Conversation

@Noroth

@Noroth Noroth commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces support for event-driven subgraphs, refines the handling of subgraph attributes based on their type, and improves protocol resolution logic throughout the codebase. The main changes can be grouped into documentation updates, resource and API logic improvements, and expanded testing.

Support for event-driven subgraphs and improved protocol handling:

Documentation and resource schema updates:

  • Updated the documentation and resource schema for cosmo_subgraph to clarify that routing_url is required only for normal subgraphs and optional for event-driven subgraphs. The field is now marked as optional and computed. [1] [2]

Resource and API logic improvements:

  • Modified resource creation and update logic so that, for event-driven subgraphs, fields such as routing_url, subscription_url, subscription_protocol, and websocket_subprotocol are omitted from requests and set to null, ensuring correct API usage. [1] [2]
  • Refactored protocol resolution functions (ResolveWebsocketSubprotocol, ResolveSubscriptionProtocol) to accept pointer types, allowing for proper handling of optional protocol fields and avoiding default assignments when fields are omitted. Updated all relevant resource and API calls to use the new pointer-based logic. [1] [2] [3] [4] [5] [6]

Testing and validation:

  • Added a new acceptance test (TestAccSubgraphEventDrivenSubgraph) and supporting configuration function to validate the creation and management of event-driven subgraphs, ensuring that omitted fields behave as expected. [1] [2]

Schema enhancements for event-driven subgraphs:

  • Introduced a comprehensive test schema (TestAccValidEventDrivenSubgraphSchema) with various event-driven directives and types to support robust testing of event-driven subgraph features.

Comment thread docs/resources/subgraph.md
Comment thread internal/service/subgraph/resource_cosmo_subgraph.go

@StarpTech StarpTech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Noroth Noroth merged commit 898e732 into main Aug 20, 2025
3 checks passed
@Noroth Noroth deleted the ludwig/eng-7507-configuration-errors-with-edg-subgraph-in-terraform branch August 20, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants