Skip to content

Commit 0d3a624

Browse files
committed
Fixed file access mode when updating the subgraph config.
1 parent d0ac6ab commit 0d3a624

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/HotChocolate/Fusion/src/CommandLine/Helpers/PackageHelper.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ public static async Task<SubgraphConfigurationDto> LoadSubgraphConfigFromSubgrap
5757

5858
public static async Task ReplaceSubgraphConfigInSubgraphPackageAsync(
5959
string packageFile,
60-
SubgraphConfigurationDto config,
61-
CancellationToken ct = default)
60+
SubgraphConfigurationDto config)
6261
{
63-
using var package = Package.Open(packageFile, FileMode.Open, FileAccess.Read);
62+
using var package = Package.Open(packageFile, FileMode.Open, FileAccess.ReadWrite);
6463
await ReplaceTransportConfigInPackageAsync(package, config);
6564
}
6665

@@ -362,8 +361,6 @@ private static async Task ReplaceTransportConfigInPackageAsync(
362361
await using var stream = part.GetStream(FileMode.Create);
363362
await using var writer = new StreamWriter(stream, Encoding.UTF8);
364363
await writer.WriteAsync(FormatSubgraphConfig(subgraphConfig));
365-
366-
package.CreateRelationship(part.Uri, TargetMode.Internal, _subgraphConfigKind, _subgraphConfigId);
367364
}
368365

369366
private static async Task<SubgraphConfigurationDto> ReadSubgraphConfigPartAsync(

0 commit comments

Comments
 (0)