Skip to content

Commit

Permalink
Fusion Graph Composition (#5880)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Mar 4, 2023
1 parent 888fa21 commit 3146208
Show file tree
Hide file tree
Showing 190 changed files with 7,570 additions and 1,715 deletions.
4 changes: 3 additions & 1 deletion src/CookieCrumble/src/CookieCrumble/CookieCrumble.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@

<ItemGroup>
<PackageReference Include="DiffPlex" Version="1.7.1" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Xunit" Version="2.4.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\HotChocolate\Core\src\Core\HotChocolate.Core.csproj" />
<ProjectReference Include="..\..\..\HotChocolate\AspNetCore\src\AspNetCore\HotChocolate.AspNetCore.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net6.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ProjectReference Include="..\..\..\HotChocolate\Fusion\src\Core\HotChocolate.Fusion.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if NET6_0_OR_GREATER
#if NET7_0_OR_GREATER
using System.Buffers;
using HotChocolate.Fusion.Planning;

Expand Down
2 changes: 1 addition & 1 deletion src/CookieCrumble/src/CookieCrumble/Snapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed class Snapshot
new ExceptionSnapshotValueFormatter(),
new SchemaErrorSnapshotValueFormatter(),
new HttpResponseSnapshotValueFormatter(),
#if NET6_0_OR_GREATER
#if NET7_0_OR_GREATER
new QueryPlanSnapshotValueFormatter(),
#endif
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace HotChocolate.Caching.Http.Tests;
public class HttpCachingTests : ServerTestBase
{
public HttpCachingTests(TestServerFactory serverFactory)
: base(serverFactory)
: base(serverFactory)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="7.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/HotChocolate/Fusion/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))" />

<PropertyGroup>
<TargetFrameworks>$(Library2TargetFrameworks)</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
</PropertyGroup>

</Project>
28 changes: 28 additions & 0 deletions src/HotChocolate/Fusion/HotChocolate.Fusion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0EF9C546-2
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Fusion.Tests", "test\Core.Tests\HotChocolate.Fusion.Tests.csproj", "{8B39E90B-DC1D-4F2C-851A-33333F67BDCC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Fusion.Composition", "src\Composition\HotChocolate.Fusion.Composition.csproj", "{F244D5A2-9478-41A8-B3D2-891D1BAE53CF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Fusion.Composition.Tests", "test\Composition.Tests\HotChocolate.Fusion.Composition.Tests.csproj", "{DEE7F756-AF1B-46DA-944E-95B91A8E562A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Fusion.Abstractions", "src\Abstractions\HotChocolate.Fusion.Abstractions.csproj", "{63B597BD-DCFE-49CD-92A2-D819236B1643}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Fusion.Abstractions.Tests", "test\Abstractions.Tests\HotChocolate.Fusion.Abstractions.Tests.csproj", "{8DB4AD09-9CCE-4A0D-A169-4578167514B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -28,9 +36,29 @@ Global
{8B39E90B-DC1D-4F2C-851A-33333F67BDCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B39E90B-DC1D-4F2C-851A-33333F67BDCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B39E90B-DC1D-4F2C-851A-33333F67BDCC}.Release|Any CPU.Build.0 = Release|Any CPU
{F244D5A2-9478-41A8-B3D2-891D1BAE53CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F244D5A2-9478-41A8-B3D2-891D1BAE53CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F244D5A2-9478-41A8-B3D2-891D1BAE53CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F244D5A2-9478-41A8-B3D2-891D1BAE53CF}.Release|Any CPU.Build.0 = Release|Any CPU
{DEE7F756-AF1B-46DA-944E-95B91A8E562A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEE7F756-AF1B-46DA-944E-95B91A8E562A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEE7F756-AF1B-46DA-944E-95B91A8E562A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEE7F756-AF1B-46DA-944E-95B91A8E562A}.Release|Any CPU.Build.0 = Release|Any CPU
{63B597BD-DCFE-49CD-92A2-D819236B1643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63B597BD-DCFE-49CD-92A2-D819236B1643}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63B597BD-DCFE-49CD-92A2-D819236B1643}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63B597BD-DCFE-49CD-92A2-D819236B1643}.Release|Any CPU.Build.0 = Release|Any CPU
{8DB4AD09-9CCE-4A0D-A169-4578167514B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DB4AD09-9CCE-4A0D-A169-4578167514B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DB4AD09-9CCE-4A0D-A169-4578167514B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DB4AD09-9CCE-4A0D-A169-4578167514B8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{0355AF0F-B91D-4852-8C9F-8E13CE5C88F3} = {748FCFC6-3EE7-4CFD-AFB3-B0F7B1ACD026}
{8B39E90B-DC1D-4F2C-851A-33333F67BDCC} = {0EF9C546-286E-407F-A02E-731804507FDE}
{F244D5A2-9478-41A8-B3D2-891D1BAE53CF} = {748FCFC6-3EE7-4CFD-AFB3-B0F7B1ACD026}
{DEE7F756-AF1B-46DA-944E-95B91A8E562A} = {0EF9C546-286E-407F-A02E-731804507FDE}
{63B597BD-DCFE-49CD-92A2-D819236B1643} = {748FCFC6-3EE7-4CFD-AFB3-B0F7B1ACD026}
{8DB4AD09-9CCE-4A0D-A169-4578167514B8} = {0EF9C546-286E-407F-A02E-731804507FDE}
EndGlobalSection
EndGlobal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>

<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">

</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="FusionTypeNames_NoSchemaDef" xml:space="preserve">
<value>The provided document must at least contain a schema definition.</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
namespace HotChocolate.Fusion;

/// <summary>
/// Defines the names of the arguments that can be used with the fusion directives.
/// </summary>
internal static class FusionDirectiveArgumentNames
{
/// <summary>
/// Gets the name of the name argument.
/// </summary>
public const string NameArg = "name";

/// <summary>
/// Gets the name of the select argument.
/// </summary>
public const string SelectArg = "select";

/// <summary>
/// Gets the name of the argument argument.
/// </summary>
public const string ArgumentArg = "argument";

/// <summary>
/// Gets the name of the type argument.
/// </summary>
public const string TypeArg = "type";

/// <summary>
/// Gets the name of the subgraph argument.
/// </summary>
public const string SubgraphArg = "subgraph";

/// <summary>
/// Gets the name of the prefix argument.
/// </summary>
public const string PrefixArg = "prefix";

/// <summary>
/// Gets the name of the self prefix argument.
/// </summary>
public const string PrefixSelfArg = "prefixSelf";

/// <summary>
/// Gets the name of the version argument.
/// </summary>
public const string VersionArg = "version";

/// <summary>
/// Gets the name of the base address argument.
/// </summary>
public const string BaseAddressArg = "baseAddress";
}

63 changes: 63 additions & 0 deletions src/HotChocolate/Fusion/src/Abstractions/FusionTypeBaseNames.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
namespace HotChocolate.Fusion;

/// <summary>
/// The base type names for the fusion gateway.
/// </summary>
internal static class FusionTypeBaseNames
{
/// <summary>
/// The base name of the variable directive.
/// </summary>
public const string VariableDirective = "variable";

/// <summary>
/// The base name of the resolver directive.
/// </summary>
public const string ResolverDirective = "resolver";

/// <summary>
/// The base name of the source directive.
/// </summary>
public const string SourceDirective = "source";

/// <summary>
/// The base name of the is directive.
/// </summary>
public const string IsDirective = "is";

/// <summary>
/// The base name of the HTTP directive.
/// </summary>
public const string HttpDirective = "httpClient";

/// <summary>
/// The base name of the fusion directive.
/// </summary>
public const string FusionDirective = "fusion";

/// <summary>
/// The base name of the GraphQL selection directive.
/// </summary>
public const string Selection = "Selection";

/// <summary>
/// The base name of the GraphQL selection set directive.
/// </summary>
public const string SelectionSet = "SelectionSet";

/// <summary>
/// The base name of the GraphQL type name scalar.
/// </summary>
public const string TypeName = "TypeName";

/// <summary>
/// The base name of the GraphQL type scalar.
/// </summary>
public const string Type = "Type";

/// <summary>
/// The base name of the URI scalar.
/// </summary>
public const string Uri = "Uri";
}

Loading

0 comments on commit 3146208

Please sign in to comment.