Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ MD033:
- a
- br
- Code
- CSharp
- em
- ExampleTabs
- FusionSubscriptionsDiagram
- img
- Implementation
- InputChoiceTabs
- LanguageTabs
- List
- MochaTopologyVisualization
- PackageInstallation
Expand All @@ -28,6 +30,7 @@ MD033:
- span
- strong
- style
- TypeScript
MD036: false # Rationale: Possibly too strict, used frequently in documentation.
MD059: false # Rationale: Already used in many places in the documentation.
MD060:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ public static class GraphQLOrchestratorExtensions
/// </summary>
/// <param name="builder">The distributed application builder</param>
/// <returns>The distributed application builder for chaining</returns>
[Obsolete("Use AddNitro() instead.")]
[Obsolete("Use AddNitroComposition() instead.")]
[AspireExportIgnore(Reason = "Obsolete alias for AddNitroComposition.")]
public static IDistributedApplicationBuilder AddGraphQLOrchestrator(
this IDistributedApplicationBuilder builder)
=> builder.AddNitro();
=> builder.AddNitroComposition();
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class GraphQLResourceBuilderExtensions
/// <c>name</c> in <c>schema-settings.json</c>.
/// </param>
/// <returns>The resource builder for chaining</returns>
[AspireExport]
public static IResourceBuilder<T> WithGraphQLHttpEndpoint<T>(
this IResourceBuilder<T> builder,
string path = "/graphql",
Expand Down Expand Up @@ -80,6 +81,7 @@ public static IResourceBuilder<T> WithGraphQLHttpEndpoint<T>(
[Obsolete(
"Use WithGraphQLHttpEndpoint instead, which declares the GraphQL route of the resource "
+ "in addition to the schema download path.")]
[AspireExportIgnore(Reason = "Superseded by WithGraphQLHttpEndpoint.")]
public static IResourceBuilder<T> WithGraphQLSchemaEndpoint<T>(
this IResourceBuilder<T> builder,
string? path = null,
Expand Down Expand Up @@ -110,12 +112,13 @@ public static IResourceBuilder<T> WithGraphQLSchemaEndpoint<T>(
/// Marks a resource as having a GraphQL schema file in its project directory.
/// </summary>
/// <param name="builder">The resource builder</param>
/// <param name="fileName">The schema file name (defaults to "schema.graphql")</param>
/// <param name="fileName">The schema file name (defaults to "schema.graphqls")</param>
/// <param name="sourceSchemaName">The source schema name (defaults to the resource name)</param>
/// <returns>The resource builder for chaining</returns>
[Obsolete(
"File based source schemas are being retired. Use WithGraphQLHttpEndpoint instead, "
+ "which fetches the source schema from the endpoint of the resource.")]
[AspireExportIgnore(Reason = "Superseded by WithGraphQLHttpEndpoint.")]
public static IResourceBuilder<T> WithGraphQLSchemaFile<T>(
this IResourceBuilder<T> builder,
string fileName = "schema.graphqls",
Expand All @@ -142,12 +145,13 @@ public static IResourceBuilder<T> WithGraphQLSchemaFile<T>(
/// </param>
/// <param name="outputFileName">The output archive file name.</param>
/// <returns>The resource builder for chaining</returns>
public static IResourceBuilder<T> WithGraphQLSchemaComposition<T>(
[AspireExport]
public static IResourceBuilder<T> WithNitroComposition<T>(
this IResourceBuilder<T> builder,
bool disableValidation = false,
string outputFileName = "gateway.far")
where T : IResourceWithEndpoints
=> builder.WithGraphQLSchemaComposition(
=> builder.WithNitroComposition(
new GraphQLCompositionSettings
{
DisableSchemaValidation = disableValidation
Expand All @@ -158,14 +162,37 @@ public static IResourceBuilder<T> WithGraphQLSchemaComposition<T>(
/// Marks a resource as needing GraphQL schema composition from its referenced subgraphs.
/// </summary>
/// <param name="builder">The resource builder.</param>
/// <param name="settings">The composition settings.</param>
/// <param name="settings">
/// The composition settings. Composition settings normally come from Nitro and the settings
/// given here override them locally.
/// </param>
/// <param name="outputFileName">The output archive file name.</param>
/// <returns>The resource builder for chaining.</returns>
[Obsolete("Use WithNitroComposition instead.")]
[AspireExportIgnore(Reason = "Obsolete alias for WithNitroComposition.")]
public static IResourceBuilder<T> WithGraphQLSchemaComposition<T>(
this IResourceBuilder<T> builder,
GraphQLCompositionSettings settings,
string outputFileName = "gateway.far")
where T : IResourceWithEndpoints
=> builder.WithNitroComposition(settings, outputFileName);

/// <summary>
/// Marks a resource as needing GraphQL schema composition from its referenced subgraphs.
/// </summary>
/// <param name="builder">The resource builder.</param>
/// <param name="settings">
/// The composition settings. Composition settings normally come from Nitro and the settings
/// given here override them locally.
/// </param>
/// <param name="outputFileName">The output archive file name.</param>
/// <returns>The resource builder for chaining.</returns>
[AspireExportIgnore(Reason = "Composition settings are provided by Nitro.")]
public static IResourceBuilder<T> WithNitroComposition<T>(
this IResourceBuilder<T> builder,
GraphQLCompositionSettings settings,
string outputFileName = "gateway.far")
where T : IResourceWithEndpoints
{
builder.WithAnnotation(
new GraphQLSchemaCompositionAnnotation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<RootNamespace>HotChocolate.Fusion.Aspire</RootNamespace>
<TargetFrameworks>net11.0; net10.0; net9.0</TargetFrameworks>
<IsAotCompatible>false</IsAotCompatible>
<EnableAspireIntegrationAnalyzers>true</EnableAspireIntegrationAnalyzers>
<PackageTags>$(PackageTags) polyglot</PackageTags>
<NoWarn>$(NoWarn);ASPIREINTERACTION001</NoWarn>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal sealed class NitroCompositionOptions
public Uri? PortalUrl { get; set; }

/// <summary>
/// Gets the options that control stage update detection and automatic adoption.
/// Gets or sets the options that control stage update detection and automatic adoption.
/// </summary>
public NitroSeedUpdateOptions SeedUpdates { get; } = new();
public NitroSeedUpdateOptions SeedUpdates { get; set; } = new();
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
using Aspire.Hosting;

namespace HotChocolate.Fusion.Aspire.Nitro;

/// <summary>
/// Configures how Fusion Aspire follows changes to a Nitro stage during an AppHost run.
/// </summary>
[AspireDto]
public sealed class NitroSeedUpdateOptions
{
/// <summary>
/// Gets or sets whether Fusion Aspire subscribes to stage changes and downloads newer Fusion
/// configurations. Enabling this option adds background subscription, query, and download
/// traffic to the configured Nitro API. The default is <see langword="true"/>.
/// Gets whether Fusion Aspire subscribes to stage changes and downloads newer Fusion
/// configurations. The default is <see langword="true"/>.
/// </summary>
public bool Enabled { get; set; } = true;
public bool Enabled { get; init; } = true;

/// <summary>
/// Gets or sets whether a newly downloaded Fusion configuration is immediately applied. When
/// disabled, new configurations are staged and applied by the next local recomposition. The
/// default is <see langword="true"/>.
/// Gets whether a newly downloaded Fusion configuration is immediately applied. When disabled,
/// new configurations are staged and applied by the next local recomposition. The default is
/// <see langword="true"/>.
/// </summary>
public bool AutoUpdate { get; set; } = true;
public bool AutoUpdate { get; init; } = true;
}
Loading
Loading