diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/HotChocolateAuthorizeRequestExecutorBuilder.cs b/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/HotChocolateAuthorizeRequestExecutorBuilder.cs
index 2d1662c423e..ac39b62530f 100644
--- a/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/HotChocolateAuthorizeRequestExecutorBuilder.cs
+++ b/src/HotChocolate/AspNetCore/src/AspNetCore.Authorization.Opa/HotChocolateAuthorizeRequestExecutorBuilder.cs
@@ -44,11 +44,7 @@ public static class HotChocolateAuthorizeRequestExecutorBuilder
var jsonOptions = new JsonSerializerOptions
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
-#if NET5_0_OR_GREATER
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
-#else
- IgnoreNullValues = true
-#endif
};
jsonOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase, false));
o.JsonSerializerOptions = jsonOptions;
diff --git a/src/HotChocolate/Benchmarks/src/Benchmarks.Execution/Program.cs b/src/HotChocolate/Benchmarks/src/Benchmarks.Execution/Program.cs
index 63a57a834eb..475b3070d8b 100644
--- a/src/HotChocolate/Benchmarks/src/Benchmarks.Execution/Program.cs
+++ b/src/HotChocolate/Benchmarks/src/Benchmarks.Execution/Program.cs
@@ -25,11 +25,9 @@ private static async Task Run()
Console.WriteLine("Warmup 1");
await queryBench.Sessions_DataLoader_Large().ConfigureAwait(false);
- ;
Console.WriteLine("Warmup 2");
await queryBench.Sessions_DataLoader_Large().ConfigureAwait(false);
- ;
Console.WriteLine("Run");
diff --git a/src/HotChocolate/Core/benchmark/Execution.Benchmarks/DefaultExecutionPipelineBenchmark.cs b/src/HotChocolate/Core/benchmark/Execution.Benchmarks/DefaultExecutionPipelineBenchmark.cs
index aa509aee7f0..db80501ea49 100644
--- a/src/HotChocolate/Core/benchmark/Execution.Benchmarks/DefaultExecutionPipelineBenchmark.cs
+++ b/src/HotChocolate/Core/benchmark/Execution.Benchmarks/DefaultExecutionPipelineBenchmark.cs
@@ -138,7 +138,7 @@ public Task LargeQueryFiveParallelRequests()
}
// var jsonWriter = new HotChocolate.Execution.Serialization.JsonQueryResultSerializer(true);
- // Console.WriteLine(jsonWriter.Serialize((IReadOnlyQueryResult)result));
+ // Console.WriteLine(jsonWriter.Serialize((IQueryResult)result));
await result.DisposeAsync();
}
diff --git a/src/HotChocolate/Core/src/Abstractions/NameString.cs.txt b/src/HotChocolate/Core/src/Abstractions/NameString.cs.txt
deleted file mode 100644
index 57e80fdc6ac..00000000000
--- a/src/HotChocolate/Core/src/Abstractions/NameString.cs.txt
+++ /dev/null
@@ -1,203 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Globalization;
-using HotChocolate.Language;
-using HotChocolate.Properties;
-
-namespace HotChocolate;
-
-///
-/// The type name string guarantees that a string adheres to the
-/// GraphQL spec rules: /[_A-Za-z][_0-9A-Za-z]*/
-///
-[TypeConverter(typeof(NameStringConverter))]
-public readonly struct NameString
- : IEquatable
- , IComparable
-{
- ///
- /// Initializes a new instance of the struct.
- ///
- /// The actual type name string
- ///
- public NameString(string value)
- {
- if (!NameUtils.IsValidGraphQLName(value))
- {
- throw new ArgumentException(
- string.Format(CultureInfo.InvariantCulture,
- AbstractionResources.Type_NameIsNotValid,
- value ?? "null"),
- nameof(value));
- }
- Value = value;
- }
-
- ///
- /// The name value.
- ///
- public string Value { get; }
-
- ///
- /// true if the name is not empty
- ///
- public bool HasValue => !IsEmpty;
-
- public bool IsEmpty => string.IsNullOrEmpty(Value);
-
- ///
- /// Provides the name string.
- ///
- /// The name string value
- public override string ToString() => Value;
-
- ///
- /// Appends a to this
- /// instance and returns a new instance of
- /// representing the combined .
- ///
- /// The combined .
- public NameString Add(NameString other)
- => new(Value + other.Value);
-
- ///
- /// Compares this value to another value
- /// using a specific type.
- ///
- ///
- /// The second for comparison.
- ///
- ///
- /// The type to use.
- ///
- ///
- /// true if both values are equal.
- ///
- public bool Equals(NameString other, StringComparison comparisonType)
- => (!HasValue && !other.HasValue) || string.Equals(Value, other.Value, comparisonType);
-
- ///
- /// Compares this value to another value using
- /// comparison type.
- ///
- ///
- /// The second for comparison.
- ///
- ///
- /// true if both values are equal.
- ///
- public bool Equals(NameString other) =>
- Equals(other, StringComparison.Ordinal);
-
- ///
- /// Compares this value to another value using
- /// comparison.
- ///
- ///
- /// The second for comparison.
- ///
- ///
- /// true if both values are equal.
- ///
- public override bool Equals(object? obj)
- {
- if (obj is null)
- {
- return IsEmpty;
- }
- return obj is NameString n && Equals(n);
- }
-
-#if NET5_0_OR_GREATER
- public int CompareTo(NameString other)
- => string.CompareOrdinal(Value, other.Value);
-#else
- public int CompareTo(NameString other)
- => string.Compare(Value, other.Value, StringComparison.Ordinal);
-#endif
-
- ///
- /// Serves as a hash function for a object.
- ///
- ///
- /// A hash code for this instance that is suitable for use in hashing
- /// algorithms and data structures such as a hash table.
- ///
- public override int GetHashCode()
- => HasValue ? StringComparer.Ordinal.GetHashCode(Value) : 0;
-
- ///
- /// Operator call through to Equals
- ///
- /// The left parameter
- /// The right parameter
- ///
- /// true if both values are equal.
- ///
- public static bool operator ==(NameString left, NameString right)
- => left.Equals(right);
-
- ///
- /// Operator call through to Equals
- ///
- /// The left parameter
- /// The right parameter
- ///
- /// true if both values are not equal.
- ///
- public static bool operator !=(NameString left, NameString right)
- => !left.Equals(right);
-
- ///
- /// Concatenates a with a .
- ///
- /// The left parameter
- /// The right parameter
- /// The ToString combination of both values
- public static string operator +(string left, NameString right)
- // This overload exists to prevent the implicit string<->NameString
- // converter from trying to call the NameString+NameString operator
- // for things that are not name strings.
- => string.Concat(left, right.Value);
-
- ///
- /// Concatenates a with a .
- ///
- /// The left parameter
- /// The right parameter
- /// The ToString combination of both values
- public static string operator +(NameString left, string right)
- // This overload exists to prevent the implicit string<->NameString
- // converter from trying to call the NameString+NameString operator
- // for things that are not name strings.
- => string.Concat(left.Value, right);
-
- ///
- /// Operator call through to Add
- ///
- /// The left parameter
- /// The right parameter
- ///
- /// The combination of both values
- ///
- public static NameString operator +(NameString left, NameString right)
- => left.Add(right);
-
- ///
- /// Implicitly creates a new from
- /// the given string.
- ///
- public static implicit operator NameString(string s)
- => ConvertFromString(s);
-
- ///
- /// Implicitly calls ToString().
- ///
- public static implicit operator string(NameString name)
- => name.ToString();
-
- internal static NameString ConvertFromString(string s)
- => string.IsNullOrEmpty(s)
- ? new NameString()
- : new NameString(s);
-}
diff --git a/src/HotChocolate/Core/src/Execution/Extensions/ExecutionRequestExecutorExtensions.cs b/src/HotChocolate/Core/src/Execution/Extensions/ExecutionRequestExecutorExtensions.cs
index 4a42105c67c..2cf9adb3a83 100644
--- a/src/HotChocolate/Core/src/Execution/Extensions/ExecutionRequestExecutorExtensions.cs
+++ b/src/HotChocolate/Core/src/Execution/Extensions/ExecutionRequestExecutorExtensions.cs
@@ -74,7 +74,7 @@ public static class ExecutionRequestExecutorExtensions
public static Task ExecuteAsync(
this IRequestExecutor executor,
string query,
- IReadOnlyDictionary variableValues)
+ Dictionary variableValues)
{
if (executor is null)
{
diff --git a/src/HotChocolate/Core/src/Execution/Processing/Selection.cs b/src/HotChocolate/Core/src/Execution/Processing/Selection.cs
index e2fb426a691..6714658c023 100644
--- a/src/HotChocolate/Core/src/Execution/Processing/Selection.cs
+++ b/src/HotChocolate/Core/src/Execution/Processing/Selection.cs
@@ -6,6 +6,7 @@
using HotChocolate.Language;
using HotChocolate.Resolvers;
using HotChocolate.Types;
+using Microsoft.Extensions.ObjectPool;
namespace HotChocolate.Execution.Processing;
@@ -46,7 +47,9 @@ public class Selection : ISelection
_includeConditions = includeConditions ?? Array.Empty();
- _flags = isInternal ? Flags.Internal : Flags.None;
+ _flags = isInternal
+ ? Flags.Internal
+ : Flags.None;
if (Type.IsListType())
{
@@ -162,6 +165,7 @@ public bool IsIncluded(long includeFlags, bool allowInternals = false)
// if there are flags in most cases we just have one so we can
// check the first and optimize for this.
var includeCondition = _includeConditions[0];
+
if ((includeFlags & includeCondition) == includeCondition)
{
return !IsInternal || allowInternals;
@@ -177,6 +181,7 @@ public bool IsIncluded(long includeFlags, bool allowInternals = false)
for (var i = 1; i < _includeConditions.Length; i++)
{
includeCondition = _includeConditions[i];
+
if ((includeFlags & includeCondition) == includeCondition)
{
return !IsInternal || allowInternals;
@@ -247,7 +252,7 @@ internal void AddSelection(FieldNode selectionSyntax, long includeCondition = 0)
{
var selections = new ISelectionNode[
selectionSet.Selections.Count +
- other.SelectionSet.Selections.Count];
+ other.SelectionSet.Selections.Count];
var next = 0;
for (var i = 0; i < selectionSet.Selections.Count; i++)
diff --git a/src/HotChocolate/Core/src/Execution/Properties/InternalsVisibleTo.cs b/src/HotChocolate/Core/src/Execution/Properties/InternalsVisibleTo.cs
index 41be87ee15b..cd7f2c603b1 100644
--- a/src/HotChocolate/Core/src/Execution/Properties/InternalsVisibleTo.cs
+++ b/src/HotChocolate/Core/src/Execution/Properties/InternalsVisibleTo.cs
@@ -2,4 +2,5 @@
[assembly: InternalsVisibleTo("HotChocolate.Execution.Tests")]
[assembly: InternalsVisibleTo("HotChocolate.Execution.Benchmarks")]
+[assembly: InternalsVisibleTo("HotChocolate.Stitching")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
diff --git a/src/HotChocolate/Core/src/Fetching/DataLoaderParameterExpressionBuilder.cs b/src/HotChocolate/Core/src/Fetching/DataLoaderParameterExpressionBuilder.cs
index f70e42e22e9..a221e9f29a3 100644
--- a/src/HotChocolate/Core/src/Fetching/DataLoaderParameterExpressionBuilder.cs
+++ b/src/HotChocolate/Core/src/Fetching/DataLoaderParameterExpressionBuilder.cs
@@ -7,6 +7,7 @@
namespace HotChocolate.Fetching;
+// ReSharper disable once ClassNeverInstantiated.Global
public sealed class DataLoaderParameterExpressionBuilder : CustomParameterExpressionBuilder
{
private static readonly MethodInfo _dataLoader;
@@ -29,7 +30,7 @@ public override bool CanHandle(ParameterInfo parameter)
public override Expression Build(ParameterInfo parameter, Expression context)
{
- DataLoaderAttribute? attribute = parameter.GetCustomAttribute();
+ var attribute = parameter.GetCustomAttribute();
return string.IsNullOrEmpty(attribute?.Key)
? Expression.Call(
diff --git a/src/HotChocolate/Core/src/Fetching/Extensions/DataLoaderResolverContextExtensions.cs b/src/HotChocolate/Core/src/Fetching/Extensions/DataLoaderResolverContextExtensions.cs
index 44256402560..564f4b469b7 100644
--- a/src/HotChocolate/Core/src/Fetching/Extensions/DataLoaderResolverContextExtensions.cs
+++ b/src/HotChocolate/Core/src/Fetching/Extensions/DataLoaderResolverContextExtensions.cs
@@ -10,6 +10,7 @@
#nullable enable
+// ReSharper disable once CheckNamespace
namespace HotChocolate.Types;
public static class DataLoaderResolverContextExtensions
@@ -74,8 +75,8 @@ public static class DataLoaderResolverContextExtensions
throw new ArgumentNullException(nameof(fetch));
}
- IServiceProvider services = context.Services;
- IDataLoaderRegistry reg = services.GetRequiredService();
+ var services = context.Services;
+ var reg = services.GetRequiredService();
FetchBatchDataLoader Loader()
=> new(
dataLoaderName ?? "default",
@@ -180,8 +181,8 @@ public static class DataLoaderResolverContextExtensions
throw new ArgumentNullException(nameof(fetch));
}
- IServiceProvider services = context.Services;
- IDataLoaderRegistry reg = services.GetRequiredService();
+ var services = context.Services;
+ var reg = services.GetRequiredService();
FetchGroupedDataLoader Loader()
=> new(
dataLoaderName ?? "default",
@@ -271,8 +272,8 @@ public static class DataLoaderResolverContextExtensions
throw new ArgumentNullException(nameof(fetch));
}
- IServiceProvider services = context.Services;
- IDataLoaderRegistry reg = services.GetRequiredService();
+ var services = context.Services;
+ var reg = services.GetRequiredService();
FetchCacheDataLoader Loader()
=> new(
key ?? "default",
@@ -359,8 +360,8 @@ public static T DataLoader(this IResolverContext context, string key)
throw new ArgumentNullException(nameof(key));
}
- IServiceProvider services = context.Services;
- IDataLoaderRegistry reg = services.GetRequiredService();
+ var services = context.Services;
+ var reg = services.GetRequiredService();
return reg.GetOrRegister(key, () => CreateDataLoader(services));
}
@@ -373,15 +374,15 @@ public static T DataLoader(this IResolverContext context)
throw new ArgumentNullException(nameof(context));
}
- IServiceProvider services = context.Services;
- IDataLoaderRegistry reg = services.GetRequiredService();
+ var services = context.Services;
+ var reg = services.GetRequiredService();
return reg.GetOrRegister(() => CreateDataLoader(services));
}
private static T CreateDataLoader(IServiceProvider services)
where T : IDataLoader
{
- T registeredDataLoader = services.GetService();
+ var registeredDataLoader = services.GetService();
if (registeredDataLoader is null)
{
diff --git a/src/HotChocolate/Core/src/Fetching/Extensions/ObjectFieldDataLoaderExtensions.cs b/src/HotChocolate/Core/src/Fetching/Extensions/ObjectFieldDataLoaderExtensions.cs
index 038c59a28ec..bfd2f2f0dd4 100644
--- a/src/HotChocolate/Core/src/Fetching/Extensions/ObjectFieldDataLoaderExtensions.cs
+++ b/src/HotChocolate/Core/src/Fetching/Extensions/ObjectFieldDataLoaderExtensions.cs
@@ -12,6 +12,7 @@
#nullable enable
+// ReSharper disable once CheckNamespace
namespace HotChocolate.Types;
public static class DataLoaderObjectFieldExtensions
@@ -27,7 +28,7 @@ public static class DataLoaderObjectFieldExtensions
{
FieldMiddlewareDefinition placeholder = new(_ => _ => default, key: DataLoader);
- if (!TryGetDataLoaderTypes(dataLoaderType, out Type? keyType, out Type? valueType))
+ if (!TryGetDataLoaderTypes(dataLoaderType, out var keyType, out var valueType))
{
throw DataLoader_InvalidType(dataLoaderType);
}
@@ -42,7 +43,7 @@ public static class DataLoaderObjectFieldExtensions
IExtendedType schemaType;
if (!valueType.IsArray)
{
- IExtendedType resolverType =
+ var resolverType =
c.TypeInspector.GetType(definition.ResultType!);
schemaType = c.TypeInspector.GetType(resolverType.IsArrayOrList
@@ -94,7 +95,7 @@ public static class DataLoaderObjectFieldExtensions
.MakeGenericType(dataLoaderType, keyType, valueType);
}
- FieldMiddleware middleware = FieldClassMiddlewareFactory.Create(middlewareType);
+ var middleware = FieldClassMiddlewareFactory.Create(middlewareType);
var index = definition.MiddlewareDefinitions.IndexOf(placeholder);
definition.MiddlewareDefinitions[index] = new(middleware, key: DataLoader);
}
@@ -104,11 +105,11 @@ public static class DataLoaderObjectFieldExtensions
[NotNullWhen(true)] out Type? key,
[NotNullWhen(true)] out Type? value)
{
- foreach (Type interfaceType in type.GetInterfaces())
+ foreach (var interfaceType in type.GetInterfaces())
{
if (interfaceType.IsGenericType)
{
- Type typeDefinition = interfaceType.GetGenericTypeDefinition();
+ var typeDefinition = interfaceType.GetGenericTypeDefinition();
if (typeof(IDataLoader<,>) == typeDefinition)
{
key = interfaceType.GetGenericArguments()[0];
@@ -136,13 +137,13 @@ public GroupedDataLoaderMiddleware(FieldDelegate next)
public async Task InvokeAsync(IMiddlewareContext context)
{
- TDataLoader dataloader = context.DataLoader();
+ var dataloader = context.DataLoader();
await _next(context).ConfigureAwait(false);
if (context.Result is IReadOnlyCollection values)
{
- IReadOnlyList data = await dataloader
+ var data = await dataloader
.LoadAsync(values, context.RequestAborted)
.ConfigureAwait(false);
@@ -179,7 +180,7 @@ public DataLoaderMiddleware(FieldDelegate next)
public async Task InvokeAsync(IMiddlewareContext context)
{
- TDataLoader dataloader = context.DataLoader();
+ var dataloader = context.DataLoader();
await _next(context).ConfigureAwait(false);
diff --git a/src/HotChocolate/Core/src/Types/Resolvers/IResolverContext.cs b/src/HotChocolate/Core/src/Types/Resolvers/IResolverContext.cs
index 3f00a50cb30..ac1a594df5d 100644
--- a/src/HotChocolate/Core/src/Types/Resolvers/IResolverContext.cs
+++ b/src/HotChocolate/Core/src/Types/Resolvers/IResolverContext.cs
@@ -37,7 +37,7 @@ public interface IResolverContext : IPureResolverContext
/// resolvers to store and retrieve data during execution scoped to the
/// hierarchy.
///
- IImmutableDictionary ScopedContextData { get; set; }
+ new IImmutableDictionary ScopedContextData { get; set; }
///
/// The local context data dictionary can be used by middlewares and
diff --git a/src/HotChocolate/Core/src/Types/Types/FieldCollection.cs b/src/HotChocolate/Core/src/Types/Types/FieldCollection.cs
index 4fdc3562433..de9d833ec29 100644
--- a/src/HotChocolate/Core/src/Types/Types/FieldCollection.cs
+++ b/src/HotChocolate/Core/src/Types/Types/FieldCollection.cs
@@ -7,7 +7,7 @@
namespace HotChocolate.Types;
-public class FieldCollection : IFieldCollection where T : class, IField
+public sealed class FieldCollection : IFieldCollection where T : class, IField
{
private readonly Dictionary _fieldsLookup;
private readonly T[] _fields;
@@ -79,7 +79,7 @@ public FieldEnumerator(T[] fields)
public T Current { get; private set; } = default!;
- object? IEnumerator.Current => Current;
+ object IEnumerator.Current => Current;
public bool MoveNext()
{
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET7_0.snap
index 3c995fc3596..54355f3ca88 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableIn_Expression_NET7_0.snap
@@ -64,5 +64,5 @@ WHERE "d"."BarShort" IN (13, 14)
---------------
SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
-WHERE "d"."BarShort" = 13 OR "d"."BarShort" IS NULL
+WHERE "d"."BarShort" = 13 OR ("d"."BarShort" IS NULL)
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET7_0.snap
index b3b7074d1e5..5eef8b4803a 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotEqual_Expression_NET7_0.snap
@@ -23,7 +23,7 @@
SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
-WHERE "d"."BarShort" <> @__p_0 OR "d"."BarShort" IS NULL
+WHERE "d"."BarShort" <> @__p_0 OR ("d"."BarShort" IS NULL)
---------------
13 Result:
@@ -51,7 +51,7 @@ WHERE "d"."BarShort" <> @__p_0 OR "d"."BarShort" IS NULL
SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
-WHERE "d"."BarShort" <> @__p_0 OR "d"."BarShort" IS NULL
+WHERE "d"."BarShort" <> @__p_0 OR ("d"."BarShort" IS NULL)
---------------
null Result:
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET7_0.snap
index 79d6d075a3a..87d54ac87eb 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorComparableTests.Create_ShortNullableNotIn_Expression_NET7_0.snap
@@ -18,7 +18,7 @@
---------------
SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
-WHERE "d"."BarShort" NOT IN (12, 13) OR "d"."BarShort" IS NULL
+WHERE "d"."BarShort" NOT IN (12, 13) OR ("d"."BarShort" IS NULL)
---------------
13and14 Result:
@@ -41,7 +41,7 @@ WHERE "d"."BarShort" NOT IN (12, 13) OR "d"."BarShort" IS NULL
---------------
SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
-WHERE "d"."BarShort" NOT IN (13, 14) OR "d"."BarShort" IS NULL
+WHERE "d"."BarShort" NOT IN (13, 14) OR ("d"."BarShort" IS NULL)
---------------
13andNull Result:
@@ -64,5 +64,5 @@ WHERE "d"."BarShort" NOT IN (13, 14) OR "d"."BarShort" IS NULL
---------------
SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
-WHERE "d"."BarShort" <> 13 AND "d"."BarShort" IS NOT NULL
+WHERE "d"."BarShort" <> 13 AND ("d"."BarShort" IS NOT NULL)
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET7_0.snap
index 81c46827556..573a3ca4549 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumIn_Expression_NET7_0.snap
@@ -61,5 +61,5 @@ nullAndFoo SQL:
---------------
SELECT "d"."Id", "d"."BarEnum"
FROM "Data" AS "d"
-WHERE "d"."BarEnum" = 0 OR "d"."BarEnum" IS NULL
+WHERE "d"."BarEnum" = 0 OR ("d"."BarEnum" IS NULL)
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET7_0.snap
index 944014046d2..a441f406122 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotEqual_Expression_NET7_0.snap
@@ -26,7 +26,7 @@ BAR SQL:
SELECT "d"."Id", "d"."BarEnum"
FROM "Data" AS "d"
-WHERE "d"."BarEnum" <> @__p_0 OR "d"."BarEnum" IS NULL
+WHERE "d"."BarEnum" <> @__p_0 OR ("d"."BarEnum" IS NULL)
---------------
FOO Result:
@@ -57,7 +57,7 @@ FOO SQL:
SELECT "d"."Id", "d"."BarEnum"
FROM "Data" AS "d"
-WHERE "d"."BarEnum" <> @__p_0 OR "d"."BarEnum" IS NULL
+WHERE "d"."BarEnum" <> @__p_0 OR ("d"."BarEnum" IS NULL)
---------------
null Result:
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET7_0.snap
index 1f89fa29530..d84aa9a8e3e 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorEnumTests.Create_NullableEnumNotIn_Expression_NET7_0.snap
@@ -21,7 +21,7 @@ BarAndFoo SQL:
---------------
SELECT "d"."Id", "d"."BarEnum"
FROM "Data" AS "d"
-WHERE "d"."BarEnum" NOT IN (1, 0) OR "d"."BarEnum" IS NULL
+WHERE "d"."BarEnum" NOT IN (1, 0) OR ("d"."BarEnum" IS NULL)
---------------
FOO Result:
@@ -50,7 +50,7 @@ FOO SQL:
---------------
SELECT "d"."Id", "d"."BarEnum"
FROM "Data" AS "d"
-WHERE "d"."BarEnum" <> 0 OR "d"."BarEnum" IS NULL
+WHERE "d"."BarEnum" <> 0 OR ("d"."BarEnum" IS NULL)
---------------
nullAndFoo Result:
@@ -76,5 +76,5 @@ nullAndFoo SQL:
---------------
SELECT "d"."Id", "d"."BarEnum"
FROM "Data" AS "d"
-WHERE "d"."BarEnum" <> 0 AND "d"."BarEnum" IS NOT NULL
+WHERE "d"."BarEnum" <> 0 AND ("d"."BarEnum" IS NOT NULL)
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_CustomAllow_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_CustomAllow_NET7_0.snap
index 5d6f8c0f35a..5272280dae6 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_CustomAllow_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_CustomAllow_NET7_0.snap
@@ -30,7 +30,7 @@ FROM "Data" AS "d"
WHERE NOT EXISTS (
SELECT 1
FROM "FooNested" AS "f"
- WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR "f"."Bar" IS NULL))
+ WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR ("f"."Bar" IS NULL)))
---------------
d Result:
@@ -51,7 +51,7 @@ FROM "Data" AS "d"
WHERE NOT EXISTS (
SELECT 1
FROM "FooNested" AS "f"
- WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR "f"."Bar" IS NULL))
+ WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR ("f"."Bar" IS NULL)))
---------------
null Result:
@@ -70,5 +70,5 @@ FROM "Data" AS "d"
WHERE NOT EXISTS (
SELECT 1
FROM "FooNested" AS "f"
- WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" IS NOT NULL)
+ WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" IS NOT NULL))
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET7_0.snap
index 5d6f8c0f35a..5272280dae6 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayAllObjectStringEqual_Expression_NET7_0.snap
@@ -30,7 +30,7 @@ FROM "Data" AS "d"
WHERE NOT EXISTS (
SELECT 1
FROM "FooNested" AS "f"
- WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR "f"."Bar" IS NULL))
+ WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR ("f"."Bar" IS NULL)))
---------------
d Result:
@@ -51,7 +51,7 @@ FROM "Data" AS "d"
WHERE NOT EXISTS (
SELECT 1
FROM "FooNested" AS "f"
- WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR "f"."Bar" IS NULL))
+ WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" <> @__p_0 OR ("f"."Bar" IS NULL)))
---------------
null Result:
@@ -70,5 +70,5 @@ FROM "Data" AS "d"
WHERE NOT EXISTS (
SELECT 1
FROM "FooNested" AS "f"
- WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" IS NOT NULL)
+ WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" IS NOT NULL))
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET7_0.snap
index b78bf1a0dee..2e406a3f6ea 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArrayNoneObjectStringEqual_Expression_NET7_0.snap
@@ -163,5 +163,5 @@ FROM "Data" AS "d"
WHERE NOT (EXISTS (
SELECT 1
FROM "FooNested" AS "f"
- WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" IS NULL))
+ WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" IS NULL)))
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET7_0.snap
index c29562a4db0..53984b1028d 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorListTests.Create_ArraySomeObjectStringEqualWithNull_Expression_NET7_0.snap
@@ -150,5 +150,5 @@ FROM "Data" AS "d"
WHERE EXISTS (
SELECT 1
FROM "FooNested" AS "f"
- WHERE "d"."Id" = "f"."FooId" AND "f"."Bar" IS NULL)
+ WHERE "d"."Id" = "f"."FooId" AND ("f"."Bar" IS NULL))
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET7_0.snap
index a2b98c66259..7d678f3c178 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableEnumIn_Expression_NET7_0.snap
@@ -74,5 +74,5 @@ nullAndFoo SQL:
SELECT "d"."Id", "d"."FooId"
FROM "Data" AS "d"
LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id"
-WHERE "f"."BarEnum" = 0 OR "f"."BarEnum" IS NULL
+WHERE "f"."BarEnum" = 0 OR ("f"."BarEnum" IS NULL)
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET7_0.snap
index 4d6b526af12..31e48b2a439 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorObjectTests.Create_ObjectNullableShortIn_Expression_NET7_0.snap
@@ -94,5 +94,5 @@ WHERE "f"."BarShort" IN (13, 14)
SELECT "d"."Id", "d"."FooId"
FROM "Data" AS "d"
LEFT JOIN "FooNullable" AS "f" ON "d"."FooId" = "f"."Id"
-WHERE "f"."BarShort" = 13 OR "f"."BarShort" IS NULL
+WHERE "f"."BarShort" = 13 OR ("f"."BarShort" IS NULL)
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET7_0.snap
index 9e5adf030cd..49d3f8a2060 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringContains_Expression_NET7_0.snap
@@ -17,7 +17,7 @@ a SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NOT NULL AND (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0)
+WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0)
---------------
b Result:
@@ -39,7 +39,7 @@ b SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NOT NULL AND (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0)
+WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0)
---------------
null
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET7_0.snap
index 218abf10539..ed69058e16b 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringEndsWith_Expression_NET7_0.snap
@@ -17,7 +17,7 @@ atest SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NOT NULL AND (@__p_0 = '' OR substr("d"."Bar", -length(@__p_0)) = @__p_0 OR @__p_0 = '')
+WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR substr("d"."Bar", -length(@__p_0)) = @__p_0 OR @__p_0 = '')
---------------
btest Result:
@@ -39,7 +39,7 @@ btest SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NOT NULL AND (@__p_0 = '' OR substr("d"."Bar", -length(@__p_0)) = @__p_0 OR @__p_0 = '')
+WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR substr("d"."Bar", -length(@__p_0)) = @__p_0 OR @__p_0 = '')
---------------
null
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET7_0.snap
index f06accb8139..b08dc4ef220 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringIn_Expression_NET7_0.snap
@@ -41,7 +41,7 @@ testbtestAndNull SQL:
---------------
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" = 'testbtest' OR "d"."Bar" IS NULL
+WHERE "d"."Bar" = 'testbtest' OR ("d"."Bar" IS NULL)
---------------
testatest Result:
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET7_0.snap
index fac0647e374..d4f74c6d66e 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNoContains_Expression_NET7_0.snap
@@ -20,7 +20,7 @@ a SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NULL OR NOT (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0)
+WHERE ("d"."Bar" IS NULL) OR NOT (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0)
---------------
b Result:
@@ -45,7 +45,7 @@ b SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NULL OR NOT (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0)
+WHERE ("d"."Bar" IS NULL) OR NOT (@__p_0 = '' OR instr("d"."Bar", @__p_0) > 0)
---------------
null
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET7_0.snap
index 37cacbdc317..65b93a20ee8 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEndsWith_Expression_NET7_0.snap
@@ -20,7 +20,7 @@ atest SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NULL OR (@__p_0 <> '' AND substr("d"."Bar", -length(@__p_0)) <> @__p_0 AND @__p_0 <> '')
+WHERE ("d"."Bar" IS NULL) OR (@__p_0 <> '' AND substr("d"."Bar", -length(@__p_0)) <> @__p_0 AND @__p_0 <> '')
---------------
btest Result:
@@ -45,7 +45,7 @@ btest SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NULL OR (@__p_0 <> '' AND substr("d"."Bar", -length(@__p_0)) <> @__p_0 AND @__p_0 <> '')
+WHERE ("d"."Bar" IS NULL) OR (@__p_0 <> '' AND substr("d"."Bar", -length(@__p_0)) <> @__p_0 AND @__p_0 <> '')
---------------
null
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET7_0.snap
index 53b3004c365..de1be6d3f2d 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotEqual_Expression_NET7_0.snap
@@ -20,7 +20,7 @@ testatest SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL
+WHERE "d"."Bar" <> @__p_0 OR ("d"."Bar" IS NULL)
---------------
testbtest Result:
@@ -45,7 +45,7 @@ testbtest SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" <> @__p_0 OR "d"."Bar" IS NULL
+WHERE "d"."Bar" <> @__p_0 OR ("d"."Bar" IS NULL)
---------------
null Result:
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET7_0.snap
index 22d7f0ab28e..47664990538 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotIn_Expression_NET7_0.snap
@@ -15,7 +15,7 @@ testatestAndtestb SQL:
---------------
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" NOT IN ('testatest', 'testbtest') OR "d"."Bar" IS NULL
+WHERE "d"."Bar" NOT IN ('testatest', 'testbtest') OR ("d"."Bar" IS NULL)
---------------
testbtestAndNull Result:
@@ -35,7 +35,7 @@ testbtestAndNull SQL:
---------------
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" <> 'testbtest' AND "d"."Bar" IS NOT NULL
+WHERE "d"."Bar" <> 'testbtest' AND ("d"."Bar" IS NOT NULL)
---------------
testatest Result:
@@ -58,5 +58,5 @@ testatest SQL:
---------------
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" <> 'testatest' OR "d"."Bar" IS NULL
+WHERE "d"."Bar" <> 'testatest' OR ("d"."Bar" IS NULL)
---------------
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET7_0.snap
index bc5e00b6840..b763a55a9f1 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringNotStartsWith_Expression_NET7_0.snap
@@ -20,7 +20,7 @@ testa SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NULL OR (@__p_0 <> '' AND (NOT ("d"."Bar" LIKE @__p_0 || '%') OR substr("d"."Bar", 1, length(@__p_0)) <> @__p_0) AND @__p_0 <> '')
+WHERE ("d"."Bar" IS NULL) OR (@__p_0 <> '' AND (NOT ("d"."Bar" LIKE @__p_0 || '%') OR substr("d"."Bar", 1, length(@__p_0)) <> @__p_0) AND @__p_0 <> '')
---------------
testb Result:
@@ -45,7 +45,7 @@ testb SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NULL OR (@__p_0 <> '' AND (NOT ("d"."Bar" LIKE @__p_0 || '%') OR substr("d"."Bar", 1, length(@__p_0)) <> @__p_0) AND @__p_0 <> '')
+WHERE ("d"."Bar" IS NULL) OR (@__p_0 <> '' AND (NOT ("d"."Bar" LIKE @__p_0 || '%') OR substr("d"."Bar", 1, length(@__p_0)) <> @__p_0) AND @__p_0 <> '')
---------------
null
diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET7_0.snap b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET7_0.snap
index 7e86531136f..33bd84ca56e 100644
--- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET7_0.snap
+++ b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/__snapshots__/QueryableFilterVisitorStringTests.Create_NullableStringStartsWith_Expression_NET7_0.snap
@@ -17,7 +17,7 @@ testa SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NOT NULL AND (@__p_0 = '' OR (("d"."Bar" LIKE @__p_0 || '%') AND substr("d"."Bar", 1, length(@__p_0)) = @__p_0) OR @__p_0 = '')
+WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR (("d"."Bar" LIKE @__p_0 || '%') AND substr("d"."Bar", 1, length(@__p_0)) = @__p_0) OR @__p_0 = '')
---------------
testb Result:
@@ -39,7 +39,7 @@ testb SQL:
SELECT "d"."Id", "d"."Bar"
FROM "Data" AS "d"
-WHERE "d"."Bar" IS NOT NULL AND (@__p_0 = '' OR (("d"."Bar" LIKE @__p_0 || '%') AND substr("d"."Bar", 1, length(@__p_0)) = @__p_0) OR @__p_0 = '')
+WHERE ("d"."Bar" IS NOT NULL) AND (@__p_0 = '' OR (("d"."Bar" LIKE @__p_0 || '%') AND substr("d"."Bar", 1, length(@__p_0)) = @__p_0) OR @__p_0 = '')
---------------
null
diff --git a/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/__snapshots__/QueryableSortVisitorVariablesTests.Integration_Create_Boolean_OrderBy.snap b/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/__snapshots__/QueryableSortVisitorVariablesTests.Integration_Create_Boolean_OrderBy.snap
index 798e018358e..f42bc79c5af 100644
--- a/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/__snapshots__/QueryableSortVisitorVariablesTests.Integration_Create_Boolean_OrderBy.snap
+++ b/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/__snapshots__/QueryableSortVisitorVariablesTests.Integration_Create_Boolean_OrderBy.snap
@@ -1,7 +1,7 @@
ASC
---------------
{
- "ContentType": "application/json; charset=utf-8",
+ "ContentType": "application/graphql-response+json; charset=utf-8",
"StatusCode": "OK",
"Data": {
"root": [
@@ -21,7 +21,7 @@ ASC
DESC
---------------
{
- "ContentType": "application/json; charset=utf-8",
+ "ContentType": "application/graphql-response+json; charset=utf-8",
"StatusCode": "OK",
"Data": {
"root": [
diff --git a/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/__snapshots__/QueryableSortVisitorVariablesTests.Integration_Create_Boolean_OrderBy_NonNull.snap b/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/__snapshots__/QueryableSortVisitorVariablesTests.Integration_Create_Boolean_OrderBy_NonNull.snap
index 798e018358e..f42bc79c5af 100644
--- a/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/__snapshots__/QueryableSortVisitorVariablesTests.Integration_Create_Boolean_OrderBy_NonNull.snap
+++ b/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/__snapshots__/QueryableSortVisitorVariablesTests.Integration_Create_Boolean_OrderBy_NonNull.snap
@@ -1,7 +1,7 @@
ASC
---------------
{
- "ContentType": "application/json; charset=utf-8",
+ "ContentType": "application/graphql-response+json; charset=utf-8",
"StatusCode": "OK",
"Data": {
"root": [
@@ -21,7 +21,7 @@ ASC
DESC
---------------
{
- "ContentType": "application/json; charset=utf-8",
+ "ContentType": "application/graphql-response+json; charset=utf-8",
"StatusCode": "OK",
"Data": {
"root": [
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/BindingList.cs b/src/HotChocolate/Fusion/src/Stitching.Types/BindingList.cs
similarity index 80%
rename from src/HotChocolate/Stitching/src/Stitching.Types/BindingList.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/BindingList.cs
index 91504000dd3..846ded0dd04 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/BindingList.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/BindingList.cs
@@ -18,7 +18,7 @@ public void Add(IBinding item)
{
_count++;
- if (!_bindings.TryGetValue(item.Target, out IBinding[]? bindings))
+ if (!_bindings.TryGetValue(item.Target, out var bindings))
{
bindings = new[] { item };
_bindings.Add(item.Target, bindings);
@@ -38,7 +38,7 @@ public bool Remove(IBinding item)
SchemaCoordinate target,
[NotNullWhen(true)] out IReadOnlyList? bindings)
{
- if (_bindings.TryGetValue(target, out IBinding[]? b))
+ if (_bindings.TryGetValue(target, out var b))
{
bindings = b;
return true;
@@ -50,7 +50,7 @@ public bool Remove(IBinding item)
public bool Contains(IBinding item)
{
- if (_bindings.TryGetValue(item.Target, out IBinding[]? bindings))
+ if (_bindings.TryGetValue(item.Target, out var bindings))
{
return bindings.Length is 0
? bindings[0].Equals(item)
@@ -65,9 +65,9 @@ public bool Contains(IBinding item)
public void CopyTo(IBinding[] array, int arrayIndex)
{
var i = arrayIndex;
- foreach (IBinding[] bindings in _bindings.Values)
+ foreach (var bindings in _bindings.Values)
{
- foreach (IBinding binding in bindings)
+ foreach (var binding in bindings)
{
array[i++] = binding;
}
@@ -76,9 +76,9 @@ public void CopyTo(IBinding[] array, int arrayIndex)
public void CopyTo(BindingList bindings)
{
- foreach (KeyValuePair item in _bindings)
+ foreach (var item in _bindings)
{
- if (!bindings._bindings.TryGetValue(item.Key, out IBinding[]? b))
+ if (!bindings._bindings.TryGetValue(item.Key, out var b))
{
var copy = new IBinding[item.Value.Length];
Array.Copy(item.Value, 0, copy, 0, copy.Length);
@@ -97,9 +97,9 @@ public void CopyTo(BindingList bindings)
public IEnumerator GetEnumerator()
{
- foreach (IBinding[] bindings in _bindings.Values)
+ foreach (var bindings in _bindings.Values)
{
- foreach (IBinding binding in bindings)
+ foreach (var binding in bindings)
{
yield return binding;
}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Bindings/DependenciesBinding.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Bindings/DependenciesBinding.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Bindings/DependenciesBinding.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Bindings/DependenciesBinding.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Bindings/FetchBinding.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Bindings/FetchBinding.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Bindings/FetchBinding.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Bindings/FetchBinding.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Bindings/SourceBinding.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Bindings/SourceBinding.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Bindings/SourceBinding.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Bindings/SourceBinding.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/DefaultObjectTypeDefinitionMerger.cs b/src/HotChocolate/Fusion/src/Stitching.Types/DefaultObjectTypeDefinitionMerger.cs
similarity index 83%
rename from src/HotChocolate/Stitching/src/Stitching.Types/DefaultObjectTypeDefinitionMerger.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/DefaultObjectTypeDefinitionMerger.cs
index 8db70e482bd..2f8e2870b42 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/DefaultObjectTypeDefinitionMerger.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/DefaultObjectTypeDefinitionMerger.cs
@@ -10,13 +10,13 @@ protected override void MergeInto(ObjectTypeDefinition source, ObjectTypeDefinit
var processed = new HashSet();
var temp = new List();
- foreach (FieldDefinitionNode field in target.Definition.Fields)
+ foreach (var field in target.Definition.Fields)
{
temp.Add(field);
processed.Add(field.Name.Value);
}
- foreach (FieldDefinitionNode targetField in source.Definition.Fields)
+ foreach (var targetField in source.Definition.Fields)
{
if (processed.Add(targetField.Name.Value))
{
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/HotChocolate.Stitching.Types.csproj b/src/HotChocolate/Fusion/src/Stitching.Types/HotChocolate.Stitching.Types.csproj
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/HotChocolate.Stitching.Types.csproj
rename to src/HotChocolate/Fusion/src/Stitching.Types/HotChocolate.Stitching.Types.csproj
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/IBinding.cs b/src/HotChocolate/Fusion/src/Stitching.Types/IBinding.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/IBinding.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/IBinding.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/ITypeDefinition.cs b/src/HotChocolate/Fusion/src/Stitching.Types/ITypeDefinition.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/ITypeDefinition.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/ITypeDefinition.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/ITypeDefinitionMerger.cs b/src/HotChocolate/Fusion/src/Stitching.Types/ITypeDefinitionMerger.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/ITypeDefinitionMerger.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/ITypeDefinitionMerger.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/ObjectTypeDefinition.cs b/src/HotChocolate/Fusion/src/Stitching.Types/ObjectTypeDefinition.cs
similarity index 90%
rename from src/HotChocolate/Stitching/src/Stitching.Types/ObjectTypeDefinition.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/ObjectTypeDefinition.cs
index 418988212b1..4e7c80b1184 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/ObjectTypeDefinition.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/ObjectTypeDefinition.cs
@@ -14,7 +14,7 @@ public ObjectTypeDefinition(ObjectTypeDefinitionNode definition, string schemaNa
Definition = definition ?? throw new ArgumentNullException(nameof(definition));
Name = definition.Name.Value;
- foreach (FieldDefinitionNode field in Definition.Fields)
+ foreach (var field in Definition.Fields)
{
Bindings.Add(new SourceBinding(new(Name, field.Name.Value), schemaName));
}
@@ -45,7 +45,7 @@ public ObjectTypeDefinition(ObjectTypeDefinitionNode definition, string schemaNa
try
{
- ObjectTypeDefinitionNode definitionNode = ParseObjectTypeDefinition(s);
+ var definitionNode = ParseObjectTypeDefinition(s);
definition = new ObjectTypeDefinition(definitionNode, schemaName);
return true;
}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyComplexTypeExtension.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyComplexTypeExtension.cs
similarity index 89%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyComplexTypeExtension.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyComplexTypeExtension.cs
index 77eaafe4105..da7b64d0426 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyComplexTypeExtension.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyComplexTypeExtension.cs
@@ -13,9 +13,9 @@ internal abstract class ApplyComplexTypeExtension
{
protected override TDef Apply(TDef definition, TExt extension)
{
- IReadOnlyList directives = definition.Directives;
- IReadOnlyList interfaces = definition.Interfaces;
- IReadOnlyList fields = definition.Fields;
+ var directives = definition.Directives;
+ var interfaces = definition.Interfaces;
+ var fields = definition.Fields;
if (extension.Directives.Count > 0)
{
@@ -29,7 +29,7 @@ protected override TDef Apply(TDef definition, TExt extension)
var names = definition.Interfaces.Select(t => t.Name.Value).ToHashSet();
List? temp = null;
- foreach (NamedTypeNode type in extension.Interfaces)
+ foreach (var type in extension.Interfaces)
{
if (names.Add(type.Name.Value))
{
@@ -51,14 +51,14 @@ protected override TDef Apply(TDef definition, TExt extension)
t)));
var touched = false;
- foreach (FieldDefinitionNode extensionField in extension.Fields)
+ foreach (var extensionField in extension.Fields)
{
// By default extensions would only allow to insert new fields.
// We also use extensions as a vehicle to annotate fields.
// So if we see that there is already a field we will try to merge it.
- if (map.TryGetValue(extensionField.Name.Value, out FieldDefinitionNode? field))
+ if (map.TryGetValue(extensionField.Name.Value, out var field))
{
- FieldDefinitionNode temp =
+ var temp =
ApplyExtensions(definition.Name.Value, field, extensionField);
if (!touched)
@@ -111,8 +111,8 @@ protected override TDef Apply(TDef definition, TExt extension)
throw ApplyExtensionsMiddleware_ArgumentCountMismatch(typeName, definition, extension);
}
- IReadOnlyList arguments = definition.Arguments;
- IReadOnlyList directives = definition.Directives;
+ var arguments = definition.Arguments;
+ var directives = definition.Directives;
if (definition.Arguments.Count > 0)
{
@@ -120,8 +120,8 @@ protected override TDef Apply(TDef definition, TExt extension)
for (var i = 0; i < definition.Arguments.Count; i++)
{
- InputValueDefinitionNode arg = definition.Arguments[i];
- InputValueDefinitionNode argExt = definition.Arguments[i];
+ var arg = definition.Arguments[i];
+ var argExt = definition.Arguments[i];
if (!arg.Name.Equals(argExt.Name, SyntaxComparison.Syntax))
{
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtension.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtension.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtension.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtension.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtensionsMiddleware.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtensionsMiddleware.cs
similarity index 92%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtensionsMiddleware.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtensionsMiddleware.cs
index a6ff033d00f..9b221625742 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtensionsMiddleware.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyExtensionsMiddleware.cs
@@ -29,11 +29,11 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
for (var i = 0; i < context.Documents.Count; i++)
{
- Document document = context.Documents[i];
+ var document = context.Documents[i];
CollectTypeDefinitions(definitions, extensions, document.SyntaxTree);
CollectTypeExtensions(extensions, document.SyntaxTree);
- DocumentNode rewritten = ApplyExtensions(definitions, extensions);
+ var rewritten = ApplyExtensions(definitions, extensions);
document = new Document(document.Name, rewritten);
context.Documents = context.Documents.SetItem(i, document);
@@ -49,7 +49,7 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
List extensions,
DocumentNode document)
{
- foreach (IDefinitionNode definition in document.Definitions)
+ foreach (var definition in document.Definitions)
{
if (definition is ITypeSystemDefinitionNode typeDef)
{
@@ -75,7 +75,7 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
List extensions,
DocumentNode document)
{
- foreach (IDefinitionNode definition in document.Definitions)
+ foreach (var definition in document.Definitions)
{
if (definition is ITypeSystemExtensionNode typeExt)
{
@@ -90,7 +90,7 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
{
var preserved = new List();
- foreach (ITypeSystemExtensionNode extension in extensions)
+ foreach (var extension in extensions)
{
if (extension is SchemaExtensionNode schemaExt)
{
@@ -122,7 +122,7 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
Dictionary definitions,
SchemaExtensionNode extension)
{
- if (definitions.TryGetValue(_schema, out ITypeSystemDefinitionNode? def) &&
+ if (definitions.TryGetValue(_schema, out var def) &&
def is SchemaDefinitionNode schemaDef)
{
var directives = schemaDef.Directives.ToList();
@@ -143,12 +143,12 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
Dictionary definitions,
ITypeExtensionNode extension)
{
- if (definitions.TryGetValue(extension.Name.Value, out ITypeSystemDefinitionNode? node) &&
+ if (definitions.TryGetValue(extension.Name.Value, out var node) &&
node is ITypeDefinitionNode typeDef)
{
for (var i = 0; i < _applyExtensions.Length; i++)
{
- ITypeDefinitionNode? merged = _applyExtensions[i].TryApply(typeDef, extension);
+ var merged = _applyExtensions[i].TryApply(typeDef, extension);
if (merged is not null)
{
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyInterfaceTypeExtension.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyInterfaceTypeExtension.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyInterfaceTypeExtension.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyInterfaceTypeExtension.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyObjectTypeExtension.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyObjectTypeExtension.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyObjectTypeExtension.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/ApplyObjectTypeExtension.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/IApplyExtension.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/IApplyExtension.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyExtensions/IApplyExtension.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyExtensions/IApplyExtension.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyMissingBindings/ApplyMissingBindingsMiddleware.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyMissingBindings/ApplyMissingBindingsMiddleware.cs
similarity index 88%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyMissingBindings/ApplyMissingBindingsMiddleware.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyMissingBindings/ApplyMissingBindingsMiddleware.cs
index a017c2510b2..0a246de9ba5 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyMissingBindings/ApplyMissingBindingsMiddleware.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyMissingBindings/ApplyMissingBindingsMiddleware.cs
@@ -17,8 +17,8 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
{
for (var i = 0; i < context.Documents.Count; i++)
{
- Document document = context.Documents[i];
- DocumentNode syntaxTree = document.SyntaxTree;
+ var document = context.Documents[i];
+ var syntaxTree = document.SyntaxTree;
var bindContext = new BindingContext(document.Name);
syntaxTree = (DocumentNode)_rewriter.Rewrite(syntaxTree, bindContext);
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyMissingBindings/BindingContext.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyMissingBindings/BindingContext.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyMissingBindings/BindingContext.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyMissingBindings/BindingContext.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyMissingBindings/BindingRewriter.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyMissingBindings/BindingRewriter.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyMissingBindings/BindingRewriter.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyMissingBindings/BindingRewriter.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/ApplyRenamingMiddleware.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/ApplyRenamingMiddleware.cs
similarity index 97%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/ApplyRenamingMiddleware.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/ApplyRenamingMiddleware.cs
index e6177222ef4..15aba9dce30 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/ApplyRenamingMiddleware.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/ApplyRenamingMiddleware.cs
@@ -20,7 +20,7 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
{
for (var i = 0; i < context.Documents.Count; i++)
{
- Document doc = context.Documents[i];
+ var doc = context.Documents[i];
var renameContext = new RenameContext(doc.Name);
_indexer.Visit(doc.SyntaxTree, renameContext);
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameContext.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameContext.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameContext.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameContext.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameIndexer.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameIndexer.cs
similarity index 94%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameIndexer.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameIndexer.cs
index 46c6a102478..a05ba179030 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameIndexer.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameIndexer.cs
@@ -68,7 +68,7 @@ protected override ISyntaxVisitorAction Enter(ISyntaxNode node, RenameContext co
case FieldDefinitionNode field
when TryGetRenameInformation(field.Directives, out var dn, out var to):
- SchemaCoordinateNode coordinateNode = context.Navigator.CreateCoordinate();
+ var coordinateNode = context.Navigator.CreateCoordinate();
context.RenamedFields[coordinateNode] = new RenameInfo(to, dn);
break;
}
@@ -96,8 +96,8 @@ protected override ISyntaxVisitorAction Leave(ISyntaxNode node, RenameContext co
for (var i = 0; i < directives.Count; i++)
{
- DirectiveNode node = directives[0];
- if (RenameDirective.TryParse(node, out RenameDirective? rename))
+ var node = directives[0];
+ if (RenameDirective.TryParse(node, out var rename))
{
directive = node;
to = rename.To;
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameInfo.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameInfo.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameInfo.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameInfo.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameRewriter.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameRewriter.cs
similarity index 90%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameRewriter.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameRewriter.cs
index 93581f1178f..c47ebdd6ec6 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ApplyRenaming/RenameRewriter.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ApplyRenaming/RenameRewriter.cs
@@ -33,7 +33,7 @@ protected override void OnLeave(ISyntaxNode node, RenameContext context)
return default;
}
- if (context.RenamedTypes.TryGetValue(originalName, out RenameInfo? _))
+ if (context.RenamedTypes.TryGetValue(originalName, out var _))
{
rewrittenNode = ApplyBindDirective(
rewrittenNode,
@@ -57,7 +57,7 @@ protected override void OnLeave(ISyntaxNode node, RenameContext context)
return default;
}
- if (context.RenamedTypes.TryGetValue(originalName, out RenameInfo? _))
+ if (context.RenamedTypes.TryGetValue(originalName, out var _))
{
rewrittenNode = ApplyBindDirective(
rewrittenNode,
@@ -81,7 +81,7 @@ protected override void OnLeave(ISyntaxNode node, RenameContext context)
return default;
}
- if (context.RenamedTypes.TryGetValue(originalName, out RenameInfo? _))
+ if (context.RenamedTypes.TryGetValue(originalName, out var _))
{
rewrittenNode = ApplyBindDirective(
rewrittenNode,
@@ -105,7 +105,7 @@ protected override void OnLeave(ISyntaxNode node, RenameContext context)
return default;
}
- if (context.RenamedTypes.TryGetValue(originalName, out RenameInfo? _))
+ if (context.RenamedTypes.TryGetValue(originalName, out var _))
{
rewrittenNode = ApplyBindDirective(
rewrittenNode,
@@ -129,7 +129,7 @@ protected override void OnLeave(ISyntaxNode node, RenameContext context)
return default;
}
- if (context.RenamedTypes.TryGetValue(originalName, out RenameInfo? _))
+ if (context.RenamedTypes.TryGetValue(originalName, out var _))
{
rewrittenNode = ApplyBindDirective(
rewrittenNode,
@@ -153,7 +153,7 @@ protected override void OnLeave(ISyntaxNode node, RenameContext context)
return default;
}
- if (context.RenamedTypes.TryGetValue(originalName, out RenameInfo? _))
+ if (context.RenamedTypes.TryGetValue(originalName, out var _))
{
rewrittenNode = ApplyBindDirective(
rewrittenNode,
@@ -175,7 +175,7 @@ protected override void OnLeave(ISyntaxNode node, RenameContext context)
return default;
}
- if (context.Navigator.TryPeek(1, out ISyntaxNode? parent) &&
+ if (context.Navigator.TryPeek(1, out var parent) &&
parent.Kind is SyntaxKind.ObjectTypeDefinition or InterfaceTypeDefinition &&
context.TypesWithFieldRenames.Contains(((INamedSyntaxNode)parent).Name.Value))
{
@@ -206,7 +206,7 @@ protected override void OnLeave(ISyntaxNode node, RenameContext context)
protected override NameNode RewriteName(NameNode node, RenameContext context)
{
- if (!context.Navigator.TryPeek(1, out ISyntaxNode? parent))
+ if (!context.Navigator.TryPeek(1, out var parent))
{
return base.RewriteName(node, context);
}
@@ -218,12 +218,12 @@ InputObjectTypeDefinition or
EnumTypeDefinition or
ScalarTypeDefinition or
NamedType &&
- context.RenamedTypes.TryGetValue(node.Value, out RenameInfo? value))
+ context.RenamedTypes.TryGetValue(node.Value, out var value))
{
return node.WithValue(value.Name);
}
- if (!context.Navigator.TryPeek(2, out ISyntaxNode? grandParent))
+ if (!context.Navigator.TryPeek(2, out var grandParent))
{
return base.RewriteName(node, context);
}
@@ -258,7 +258,7 @@ ScalarTypeDefinition or
var copy = node.Directives.ToList();
- foreach (DirectiveNode directive in node.Directives)
+ foreach (var directive in node.Directives)
{
if (RenameDirective.IsOfType(directive))
{
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/BindDirective.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/BindDirective.cs
similarity index 96%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/BindDirective.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/BindDirective.cs
index 23de4f34d66..918dced00d6 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/BindDirective.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/BindDirective.cs
@@ -29,7 +29,7 @@ public static bool TryParse(DirectiveNode syntax, [NotNullWhen(true)] out BindDi
string? toValue = null;
string? asValue = null;
- foreach (ArgumentNode argument in syntax.Arguments)
+ foreach (var argument in syntax.Arguments)
{
switch (argument.Name.Value)
{
@@ -82,7 +82,7 @@ public static bool IsOfType(DirectiveNode syntax)
bool hasTo = false, hasAs = false;
- foreach (ArgumentNode argument in syntax.Arguments)
+ foreach (var argument in syntax.Arguments)
{
if (argument.Name.Value.EqualsOrdinal("to") &&
argument.Value is StringValueNode { Value.Length: > 0 })
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ISchemaMergeContext.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ISchemaMergeContext.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ISchemaMergeContext.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ISchemaMergeContext.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/MergeSchema.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/MergeSchema.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/MergeSchema.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/MergeSchema.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/MergeSchemaMiddleware.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/MergeSchemaMiddleware.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/MergeSchemaMiddleware.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/MergeSchemaMiddleware.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/PrepareDocuments/PrepareDocumentsMiddleware.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/PrepareDocuments/PrepareDocumentsMiddleware.cs
similarity index 85%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/PrepareDocuments/PrepareDocumentsMiddleware.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/PrepareDocuments/PrepareDocumentsMiddleware.cs
index 7a9c5b80918..a892f7e0edf 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/PrepareDocuments/PrepareDocumentsMiddleware.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/PrepareDocuments/PrepareDocumentsMiddleware.cs
@@ -16,15 +16,15 @@ public PrepareDocumentsMiddleware(MergeSchema next)
public async ValueTask InvokeAsync(ISchemaMergeContext context)
{
- foreach (ServiceConfiguration configuration in context.Configurations)
+ foreach (var configuration in context.Configurations)
{
var definitions = new List();
RegisterServiceInfo(definitions, configuration);
- foreach (DocumentNode document in configuration.Documents)
+ foreach (var document in configuration.Documents)
{
- foreach (IDefinitionNode definition in document.Definitions)
+ foreach (var definition in document.Definitions)
{
definitions.Add(definition);
}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/PrepareDocuments/SquashDocumentsMiddleware.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/PrepareDocuments/SquashDocumentsMiddleware.cs
similarity index 92%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/PrepareDocuments/SquashDocumentsMiddleware.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/PrepareDocuments/SquashDocumentsMiddleware.cs
index 2487541c134..450b0d83aa9 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/PrepareDocuments/SquashDocumentsMiddleware.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/PrepareDocuments/SquashDocumentsMiddleware.cs
@@ -18,7 +18,7 @@ public async ValueTask InvokeAsync(ISchemaMergeContext context)
{
var definitions = new List();
- foreach (Document document in context.Documents)
+ foreach (var document in context.Documents)
{
definitions.AddRange(document.SyntaxTree.Definitions);
}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/RenameDirective.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/RenameDirective.cs
similarity index 92%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/RenameDirective.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/RenameDirective.cs
index 2687c2a9a6f..1f89fe549db 100644
--- a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/RenameDirective.cs
+++ b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/RenameDirective.cs
@@ -21,7 +21,7 @@ public RenameDirective(string to)
{
if (syntax.Arguments.Count == 1)
{
- ArgumentNode argument = syntax.Arguments[0];
+ var argument = syntax.Arguments[0];
if (argument.Name.Value.EqualsOrdinal("to") &&
argument.Value is StringValueNode sv &&
sv.Value.Length > 0)
@@ -42,7 +42,7 @@ public static bool IsOfType(DirectiveNode syntax)
{
if (syntax.Arguments.Count == 1)
{
- ArgumentNode argument = syntax.Arguments[0];
+ var argument = syntax.Arguments[0];
if (argument.Name.Value.EqualsOrdinal("to"))
{
return true;
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/SchemaMergeContext.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/SchemaMergeContext.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/SchemaMergeContext.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/SchemaMergeContext.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/SchemaMergePipelineBuilder.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/SchemaMergePipelineBuilder.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/SchemaMergePipelineBuilder.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/SchemaMergePipelineBuilder.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ServiceConfiguration.cs b/src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ServiceConfiguration.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/Pipeline/ServiceConfiguration.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/Pipeline/ServiceConfiguration.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/ThrowHelper.cs b/src/HotChocolate/Fusion/src/Stitching.Types/ThrowHelper.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/ThrowHelper.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/ThrowHelper.cs
diff --git a/src/HotChocolate/Stitching/src/Stitching.Types/TypeDefinitionMerger.cs b/src/HotChocolate/Fusion/src/Stitching.Types/TypeDefinitionMerger.cs
similarity index 100%
rename from src/HotChocolate/Stitching/src/Stitching.Types/TypeDefinitionMerger.cs
rename to src/HotChocolate/Fusion/src/Stitching.Types/TypeDefinitionMerger.cs
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionMergerTests.cs b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionMergerTests.cs
similarity index 90%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionMergerTests.cs
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionMergerTests.cs
index 6c5748e99b9..f3fc93e45de 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionMergerTests.cs
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionMergerTests.cs
@@ -1,6 +1,5 @@
+using CookieCrumble;
using HotChocolate.Stitching.Types.Bindings;
-using Snapshooter.Xunit;
-using Xunit;
namespace HotChocolate.Stitching.Types;
@@ -15,14 +14,14 @@ public void Merge_Simple_Type()
a: String
}",
"Abc",
- out ObjectTypeDefinition? a);
+ out var a);
ObjectTypeDefinition.TryParse(
@"type Foo {
b: String
}",
"Def",
- out ObjectTypeDefinition? b);
+ out var b);
// act
var merger = new DefaultObjectTypeDefinitionMerger();
@@ -45,14 +44,14 @@ public void Same_Field_In_Each_Schema_Version()
a: String
}",
"Abc",
- out ObjectTypeDefinition? a);
+ out var a);
ObjectTypeDefinition.TryParse(
@"type Foo {
a: String
}",
"Def",
- out ObjectTypeDefinition? b);
+ out var b);
// act
var merger = new DefaultObjectTypeDefinitionMerger();
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionTests.cs b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionTests.cs
similarity index 91%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionTests.cs
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionTests.cs
index 6df12742178..2d9b641f523 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionTests.cs
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/DefaultObjectTypeDefinitionTests.cs
@@ -14,7 +14,7 @@ public void TryParse()
a: String
}",
"Abc",
- out ObjectTypeDefinition? definition);
+ out var definition);
Assert.True(success);
Assert.NotNull(definition);
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/HotChocolate.Stitching.Types.Tests.csproj b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/HotChocolate.Stitching.Types.Tests.csproj
similarity index 100%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/HotChocolate.Stitching.Types.Tests.csproj
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/HotChocolate.Stitching.Types.Tests.csproj
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyExtensionsMiddlewareTests.cs b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyExtensionsMiddlewareTests.cs
similarity index 84%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyExtensionsMiddlewareTests.cs
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyExtensionsMiddlewareTests.cs
index 1ca6e2e764a..26c0fed6c43 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyExtensionsMiddlewareTests.cs
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyExtensionsMiddlewareTests.cs
@@ -1,10 +1,6 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+using CookieCrumble;
using HotChocolate.Stitching.Types.Pipeline.ApplyExtensions;
using HotChocolate.Stitching.Types.Pipeline.PrepareDocuments;
-using Snapshooter.Xunit;
-using Xunit;
using static HotChocolate.Language.Utf8GraphQLParser;
namespace HotChocolate.Stitching.Types.Pipeline;
@@ -15,7 +11,7 @@ public class ApplyExtensionsMiddlewareTests
public async Task Apply_Object_Extension_Single_Document()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -34,14 +30,14 @@ public async Task Apply_Object_Extension_Single_Document()
await pipeline(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Object_Extension_Is_Preserved()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -60,14 +56,14 @@ public async Task Apply_Object_Extension_Is_Preserved()
await pipeline(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Object_Extension_Merge_Field_Directives_Single_Document()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -86,14 +82,14 @@ public async Task Apply_Object_Extension_Merge_Field_Directives_Single_Document(
await pipeline(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Object_Extension_Merge_Directives_Single_Document()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -110,14 +106,14 @@ public async Task Apply_Object_Extension_Merge_Directives_Single_Document()
await pipeline(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Object_Extension_Merge_Directives_2_Single_Document()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -134,14 +130,14 @@ public async Task Apply_Object_Extension_Merge_Directives_2_Single_Document()
await pipeline(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact(Skip = "This needs to be fixed.")]
public async Task Apply_Object_Extension_Field_Type_Mismatch()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -167,7 +163,7 @@ public async Task Apply_Object_Extension_Field_Type_Mismatch()
public async Task Apply_Local_Remove()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -186,7 +182,7 @@ public async Task Apply_Local_Remove()
await pipeline(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
private MergeSchema CreatePipeline()
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyLocalRenamingMiddlewareTests.cs b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyLocalRenamingMiddlewareTests.cs
similarity index 86%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyLocalRenamingMiddlewareTests.cs
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyLocalRenamingMiddlewareTests.cs
index 8e95e500d7d..576866cfbe8 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyLocalRenamingMiddlewareTests.cs
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyLocalRenamingMiddlewareTests.cs
@@ -1,12 +1,8 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+using CookieCrumble;
using HotChocolate.Language;
using HotChocolate.Stitching.Types.Pipeline.ApplyExtensions;
using HotChocolate.Stitching.Types.Pipeline.ApplyRenaming;
using HotChocolate.Stitching.Types.Pipeline.PrepareDocuments;
-using Snapshooter.Xunit;
-using Xunit;
namespace HotChocolate.Stitching.Types.Pipeline;
@@ -16,7 +12,7 @@ public class ApplyLocalRenamingMiddlewareTests
public async Task Apply_Local_Rename()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -38,14 +34,14 @@ public async Task Apply_Local_Rename()
await pipeline.Invoke(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Local_Rename_Interface_Name()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -67,14 +63,14 @@ interface IFoo {
await pipeline.Invoke(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Local_Rename_Object_And_Refactor_Usages()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -96,14 +92,14 @@ public async Task Apply_Local_Rename_Object_And_Refactor_Usages()
await pipeline.Invoke(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Local_Rename_Scalar_And_Update_Usages()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"abc",
@@ -132,14 +128,14 @@ public async Task Apply_Local_Rename_Scalar_And_Update_Usages()
await pipeline.Invoke(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Local_Rename_Interface_Field()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"SchemaName",
@@ -163,14 +159,14 @@ interface IFoo {
await pipeline.Invoke(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
[Fact]
public async Task Apply_Local_Rename_Interface_Field_2()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"SchemaName",
@@ -200,7 +196,7 @@ interface IFooExt implements IFoo {
await pipeline.Invoke(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
private MergeSchema CreatePipeline()
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyMissingBindingsMiddlewareTests.cs b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyMissingBindingsMiddlewareTests.cs
similarity index 89%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyMissingBindingsMiddlewareTests.cs
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyMissingBindingsMiddlewareTests.cs
index 08bcd12383c..853afb17350 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/ApplyMissingBindingsMiddlewareTests.cs
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/ApplyMissingBindingsMiddlewareTests.cs
@@ -1,13 +1,9 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+using CookieCrumble;
using HotChocolate.Language;
using HotChocolate.Stitching.Types.Pipeline.ApplyExtensions;
using HotChocolate.Stitching.Types.Pipeline.ApplyMissingBindings;
using HotChocolate.Stitching.Types.Pipeline.ApplyRenaming;
using HotChocolate.Stitching.Types.Pipeline.PrepareDocuments;
-using Snapshooter.Xunit;
-using Xunit;
namespace HotChocolate.Stitching.Types.Pipeline;
@@ -17,7 +13,7 @@ public class ApplyMissingBindingsMiddlewareTests
public async Task Apply_Missing_Bindings()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var service = new ServiceConfiguration(
"SchemaName",
@@ -47,7 +43,7 @@ interface IFooExt implements IFoo {
await pipeline.Invoke(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
private MergeSchema CreatePipeline()
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/FullPipelineTests.cs b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/FullPipelineTests.cs
similarity index 70%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/FullPipelineTests.cs
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/FullPipelineTests.cs
index 3caf2aecf84..b3f540b04f7 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/FullPipelineTests.cs
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/FullPipelineTests.cs
@@ -1,13 +1,5 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
+using CookieCrumble;
using HotChocolate.Language;
-using HotChocolate.Stitching.Types.Pipeline.ApplyExtensions;
-using HotChocolate.Stitching.Types.Pipeline.ApplyMissingBindings;
-using HotChocolate.Stitching.Types.Pipeline.ApplyRenaming;
-using HotChocolate.Stitching.Types.Pipeline.PrepareDocuments;
-using Snapshooter.Xunit;
-using Xunit;
namespace HotChocolate.Stitching.Types.Pipeline;
@@ -17,7 +9,7 @@ public class FullPipelineTests
public async Task Apply_Local_Remove()
{
// arrange
- MergeSchema pipeline = CreatePipeline();
+ var pipeline = CreatePipeline();
var serviceA = new ServiceConfiguration(
"ServiceA",
@@ -50,7 +42,7 @@ public async Task Apply_Local_Remove()
await pipeline(context);
// assert
- context.Documents.Single().SyntaxTree.ToString().MatchSnapshot();
+ context.Documents.Single().SyntaxTree.MatchSnapshot();
}
private MergeSchema CreatePipeline()
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Local_Remove.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Local_Remove.graphql
similarity index 50%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Local_Remove.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Local_Remove.graphql
index 857c83616e8..2da2ddea366 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Local_Remove.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Local_Remove.graphql
@@ -1,7 +1,7 @@
-schema @_hc_service(name: "abc") {
+schema @_hc_service(name: "abc") {
}
type Foo @a {
abc: String @remove
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Is_Preserved.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Is_Preserved.graphql
similarity index 77%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Is_Preserved.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Is_Preserved.graphql
index eaa1f7d224e..06ab36f5daf 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Is_Preserved.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Is_Preserved.graphql
@@ -1,4 +1,4 @@
-extend type Bar {
+extend type Bar {
def: String
}
@@ -8,4 +8,4 @@ schema @_hc_service(name: "abc") {
type Foo {
abc: String
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_2_Single_Document.graphql b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_2_Single_Document.graphql
new file mode 100644
index 00000000000..98fd27ea2e9
--- /dev/null
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_2_Single_Document.graphql
@@ -0,0 +1,7 @@
+schema @_hc_service(name: "abc") {
+
+}
+
+type Foo @a @b {
+ abc: String
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_Single_Document.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_Single_Document.graphql
similarity index 50%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_Single_Document.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_Single_Document.graphql
index 8124d3987a0..f15cde94132 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_Single_Document.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Directives_Single_Document.graphql
@@ -1,7 +1,7 @@
-schema @_hc_service(name: "abc") {
+schema @_hc_service(name: "abc") {
}
type Foo @directive {
abc: String
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Field_Directives_Single_Document.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Field_Directives_Single_Document.graphql
similarity index 50%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Field_Directives_Single_Document.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Field_Directives_Single_Document.graphql
index 39f886e2274..e5f01bc14a1 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Field_Directives_Single_Document.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Merge_Field_Directives_Single_Document.graphql
@@ -1,7 +1,7 @@
-schema @_hc_service(name: "abc") {
+schema @_hc_service(name: "abc") {
}
type Foo {
abc: String @directive
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Single_Document.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Single_Document.graphql
similarity index 51%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Single_Document.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Single_Document.graphql
index 0c1976ad3e6..74a88f0eff0 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Single_Document.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyExtensionsMiddlewareTests.Apply_Object_Extension_Single_Document.graphql
@@ -1,8 +1,8 @@
-schema @_hc_service(name: "abc") {
+schema @_hc_service(name: "abc") {
}
type Foo {
abc: String
def: String
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename.graphql
similarity index 74%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename.graphql
index c259e731326..cb8f12630e8 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename.graphql
@@ -1,4 +1,4 @@
-schema @_hc_service(name: "abc") {
+schema @_hc_service(name: "abc") {
}
@@ -6,4 +6,4 @@ type Foo {
def: String @_hc_bind(to: "abc", as: "abc")
def: Int
ghi: Int @_hc_bind(to: "bar", as: "baz")
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field.graphql
similarity index 77%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field.graphql
index 4f52eb63d8f..60693e76b96 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field.graphql
@@ -1,4 +1,4 @@
-schema @_hc_service(name: "SchemaName") {
+schema @_hc_service(name: "SchemaName") {
}
@@ -8,4 +8,4 @@ type Foo implements IFoo {
interface IFoo {
newName: String @_hc_bind(to: "SchemaName", as: "abc")
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field_2.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field_2.graphql
similarity index 86%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field_2.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field_2.graphql
index caba703f137..ad1e0c938c9 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field_2.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Field_2.graphql
@@ -1,4 +1,4 @@
-schema @_hc_service(name: "SchemaName") {
+schema @_hc_service(name: "SchemaName") {
}
@@ -14,4 +14,4 @@ interface IFoo {
interface IFooExt implements IFoo {
newName: String @_hc_bind(to: "SchemaName", as: "abc")
def: String
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Name.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Name.graphql
similarity index 73%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Name.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Name.graphql
index cf7dc8557da..092919cbee8 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Name.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Interface_Name.graphql
@@ -1,4 +1,4 @@
-schema @_hc_service(name: "abc") {
+schema @_hc_service(name: "abc") {
}
@@ -8,4 +8,4 @@ type Foo implements IDef {
interface IDef @_hc_bind(to: "abc", as: "IFoo") {
abc: String
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Object_And_Refactor_Usages.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Object_And_Refactor_Usages.graphql
similarity index 57%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Object_And_Refactor_Usages.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Object_And_Refactor_Usages.graphql
index 29711cc6630..ffce7b1ca51 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Object_And_Refactor_Usages.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Object_And_Refactor_Usages.graphql
@@ -1,4 +1,4 @@
-schema @_hc_service(name: "abc") {
+schema @_hc_service(name: "abc") {
}
@@ -10,4 +10,4 @@ type Bar @_hc_bind(to: "abc", as: "Foo") {
abc: String
}
-union FooOrBaz = Bar | Baz
+union FooOrBaz = Bar | Baz
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Scalar_And_Update_Usages.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Scalar_And_Update_Usages.graphql
similarity index 85%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Scalar_And_Update_Usages.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Scalar_And_Update_Usages.graphql
index f05be6ca131..8262190be9e 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Scalar_And_Update_Usages.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyLocalRenamingMiddlewareTests.Apply_Local_Rename_Scalar_And_Update_Usages.graphql
@@ -1,4 +1,4 @@
-extend scalar String @rename(to: "SpecialString")
+extend scalar String @rename(to: "SpecialString")
schema @_hc_service(name: "abc") {
@@ -17,4 +17,4 @@ type Foo {
input FooInput {
a: [SpecialString!]!
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyMissingBindingsMiddlewareTests.Apply_Missing_Bindings.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyMissingBindingsMiddlewareTests.Apply_Missing_Bindings.graphql
similarity index 88%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyMissingBindingsMiddlewareTests.Apply_Missing_Bindings.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyMissingBindingsMiddlewareTests.Apply_Missing_Bindings.graphql
index e4a7db9c070..9088bbbd0e3 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyMissingBindingsMiddlewareTests.Apply_Missing_Bindings.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/ApplyMissingBindingsMiddlewareTests.Apply_Missing_Bindings.graphql
@@ -1,4 +1,4 @@
-schema @_hc_service(name: "SchemaName") {
+schema @_hc_service(name: "SchemaName") {
}
@@ -14,4 +14,4 @@ interface IFoo {
interface IFooExt implements IFoo {
newName: String @_hc_bind(to: "SchemaName", as: "abc")
def: String @_hc_bind(to: "SchemaName")
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/FullPipelineTests.Apply_Local_Remove.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/FullPipelineTests.Apply_Local_Remove.graphql
similarity index 77%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/FullPipelineTests.Apply_Local_Remove.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/FullPipelineTests.Apply_Local_Remove.graphql
index 67010969e52..27b7357a24a 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/Pipeline/__snapshots__/FullPipelineTests.Apply_Local_Remove.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/Pipeline/__snapshots__/FullPipelineTests.Apply_Local_Remove.graphql
@@ -1,4 +1,4 @@
-schema @_hc_service(name: "ServiceA") @_hc_service(name: "ServiceB") {
+schema @_hc_service(name: "ServiceA") @_hc_service(name: "ServiceB") {
}
@@ -11,4 +11,4 @@ type Foo {
xyz: String @_hc_bind(to: "ServiceA", as: "abc")
zzz: Float @_hc_bind(to: "ServiceA") @_hc_bind(to: "ServiceB")
abc: Int @_hc_bind(to: "ServiceB")
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Merge_Simple_Type.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Merge_Simple_Type.snap
similarity index 60%
rename from src/HotChocolate/Stitching/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Merge_Simple_Type.snap
rename to src/HotChocolate/Fusion/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Merge_Simple_Type.snap
index 45ed27f6c39..bc4bb08e36c 100644
--- a/src/HotChocolate/Stitching/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Merge_Simple_Type.snap
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Merge_Simple_Type.snap
@@ -1,4 +1,4 @@
-type Foo {
+type Foo {
b: String
a: String
-}
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Fusion/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Same_Field_In_Each_Schema_Version.snap b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Same_Field_In_Each_Schema_Version.snap
new file mode 100644
index 00000000000..f6822ff4d96
--- /dev/null
+++ b/src/HotChocolate/Fusion/test/Stitching.Types.Tests/__snapshots__/DefaultObjectTypeDefinitionMergerTests.Same_Field_In_Each_Schema_Version.snap
@@ -0,0 +1,3 @@
+type Foo {
+ a: String
+}
\ No newline at end of file
diff --git a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Utilities.cs b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Utilities.cs
index bb88969bd61..d5b9fb29981 100644
--- a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Utilities.cs
+++ b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Utilities.cs
@@ -8,8 +8,9 @@ namespace HotChocolate.Language;
public ref partial struct Utf8GraphQLParser
{
+ // note: this is internal for legacy stitching
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private NameNode ParseName()
+ internal NameNode ParseName()
{
var start = Start();
var name = ExpectName();
@@ -22,8 +23,9 @@ private NameNode ParseName()
);
}
+ // note: this is internal for legacy stitching
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private bool MoveNext() => _reader.MoveNext();
+ internal bool MoveNext() => _reader.MoveNext();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private TokenInfo Start()
@@ -69,11 +71,13 @@ private string ExpectName()
throw new SyntaxException(_reader, Parser_InvalidToken, TokenKind.Name, _reader.Kind);
}
+ // note: this is internal for legacy stitching
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private void ExpectColon() => Expect(TokenKind.Colon);
+ internal void ExpectColon() => Expect(TokenKind.Colon);
+ // note: this is internal for the stitching legacy layer
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private void ExpectDollar() => Expect(TokenKind.Dollar);
+ internal void ExpectDollar() => Expect(TokenKind.Dollar);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ExpectAt() => Expect(TokenKind.At);
@@ -97,8 +101,9 @@ private string ExpectString()
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ExpectSpread() => Expect(TokenKind.Spread);
+ // note: this is internal for legacy stitching
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- private void ExpectRightParenthesis() => Expect(TokenKind.RightParenthesis);
+ internal void ExpectRightParenthesis() => Expect(TokenKind.RightParenthesis);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ExpectRightBrace() => Expect(TokenKind.RightBrace);
diff --git a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Values.cs b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Values.cs
index 16a7bdcc6ea..a2a9cd66e53 100644
--- a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Values.cs
+++ b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.Values.cs
@@ -9,6 +9,7 @@ namespace HotChocolate.Language;
// Implements the parsing rules in the Values section.
public ref partial struct Utf8GraphQLParser
{
+ // note: this is internal for the stitching legacy layer
///
/// Parses a value.
/// :
@@ -29,7 +30,7 @@ namespace HotChocolate.Language;
/// Defines if only constant values are allowed;
/// otherwise, variables are allowed.
///
- private IValueNode ParseValueLiteral(bool isConstant)
+ internal IValueNode ParseValueLiteral(bool isConstant)
{
if (_reader.Kind == TokenKind.LeftBracket)
{
diff --git a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.cs b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.cs
index 0701bdbdffd..704ecf6677e 100644
--- a/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.cs
+++ b/src/HotChocolate/Language/src/Language.Utf8/Utf8GraphQLParser.cs
@@ -54,6 +54,17 @@ namespace HotChocolate.Language;
///
public int ParsedSyntaxNodes => _parsedNodes;
+ ///
+ /// Defines if the parser reached the end of the source text.
+ ///
+ public bool IsEndOfFile => _reader.Kind is TokenKind.EndOfFile;
+
+ // note: we added this internal access for legacy stitching.
+ ///
+ /// Provides internal access to the underlying GraphQL reader.
+ ///
+ internal Utf8GraphQLReader Reader => _reader;
+
public DocumentNode Parse()
{
_parsedNodes = 0;
diff --git a/src/HotChocolate/Language/src/Language.Visitors/SyntaxRewriter~1.cs b/src/HotChocolate/Language/src/Language.Visitors/SyntaxRewriter~1.cs
index 0d7c7386b65..2441f60954c 100644
--- a/src/HotChocolate/Language/src/Language.Visitors/SyntaxRewriter~1.cs
+++ b/src/HotChocolate/Language/src/Language.Visitors/SyntaxRewriter~1.cs
@@ -144,9 +144,7 @@ protected virtual TContext OnEnter(ISyntaxNode node, TContext context)
if (!ReferenceEquals(definitions, node.Definitions))
{
- return new DocumentNode(
- node.Location,
- definitions);
+ return new DocumentNode(node.Location, definitions);
}
return node;
diff --git a/src/HotChocolate/Stitching/HotChocolate.Stitching.sln b/src/HotChocolate/Stitching/HotChocolate.Stitching.sln
index d9397e4b053..a4b8162ec84 100644
--- a/src/HotChocolate/Stitching/HotChocolate.Stitching.sln
+++ b/src/HotChocolate/Stitching/HotChocolate.Stitching.sln
@@ -41,9 +41,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Execution", ".
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.AspNetCore.Tests", "..\AspNetCore\test\AspNetCore.Tests\HotChocolate.AspNetCore.Tests.csproj", "{709EE9F8-BA48-4C5A-8BDA-96B96689A1FC}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Stitching.Types.Tests", "test\Stitching.Types.Tests\HotChocolate.Stitching.Types.Tests.csproj", "{12A50382-A67F-44AB-A665-56A10DE0E8E8}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Stitching", "src\Stitching\HotChocolate.Stitching.csproj", "{C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Stitching.Types", "src\Stitching.Types\HotChocolate.Stitching.Types.csproj", "{AD6A63BB-A445-4B44-A4A0-95B10279DB72}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Stitching.Abstractions", "src\Stitching.Abstractions\HotChocolate.Stitching.Abstractions.csproj", "{B8143A31-EC3C-4410-AC85-9C28DA022DC8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Stitching.Redis", "src\Stitching.Redis\HotChocolate.Stitching.Redis.csproj", "{EF3290BD-E6C9-452A-AAC1-22785543F4A6}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotChocolate.Stitching.Tests", "test\Stitching.Tests\HotChocolate.Stitching.Tests.csproj", "{9F9C412E-A2C4-446F-B306-E0ADFC3286F2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -211,30 +215,54 @@ Global
{709EE9F8-BA48-4C5A-8BDA-96B96689A1FC}.Release|x64.Build.0 = Release|Any CPU
{709EE9F8-BA48-4C5A-8BDA-96B96689A1FC}.Release|x86.ActiveCfg = Release|Any CPU
{709EE9F8-BA48-4C5A-8BDA-96B96689A1FC}.Release|x86.Build.0 = Release|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Debug|x64.ActiveCfg = Debug|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Debug|x64.Build.0 = Debug|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Debug|x86.ActiveCfg = Debug|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Debug|x86.Build.0 = Debug|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Release|Any CPU.Build.0 = Release|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Release|x64.ActiveCfg = Release|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Release|x64.Build.0 = Release|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Release|x86.ActiveCfg = Release|Any CPU
- {12A50382-A67F-44AB-A665-56A10DE0E8E8}.Release|x86.Build.0 = Release|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Debug|x64.ActiveCfg = Debug|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Debug|x64.Build.0 = Debug|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Debug|x86.ActiveCfg = Debug|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Debug|x86.Build.0 = Debug|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Release|Any CPU.Build.0 = Release|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Release|x64.ActiveCfg = Release|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Release|x64.Build.0 = Release|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Release|x86.ActiveCfg = Release|Any CPU
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72}.Release|x86.Build.0 = Release|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Debug|x64.Build.0 = Debug|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Debug|x86.Build.0 = Debug|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Release|x64.ActiveCfg = Release|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Release|x64.Build.0 = Release|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Release|x86.ActiveCfg = Release|Any CPU
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3}.Release|x86.Build.0 = Release|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Debug|x64.Build.0 = Debug|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Debug|x86.Build.0 = Debug|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Release|x64.ActiveCfg = Release|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Release|x64.Build.0 = Release|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Release|x86.ActiveCfg = Release|Any CPU
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8}.Release|x86.Build.0 = Release|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Debug|x64.Build.0 = Debug|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Debug|x86.Build.0 = Debug|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Release|x64.ActiveCfg = Release|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Release|x64.Build.0 = Release|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Release|x86.ActiveCfg = Release|Any CPU
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6}.Release|x86.Build.0 = Release|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Debug|x64.Build.0 = Debug|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Debug|x86.Build.0 = Debug|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Release|x64.ActiveCfg = Release|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Release|x64.Build.0 = Release|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Release|x86.ActiveCfg = Release|Any CPU
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -253,8 +281,10 @@ Global
{68ADFD79-A37C-429A-90A7-584B7E27F613} = {D7A7C1D4-6239-4B4C-A80C-E953334A83F8}
{C1CF3B06-4A02-46A6-98B2-448B5DD4E7D3} = {D7A7C1D4-6239-4B4C-A80C-E953334A83F8}
{709EE9F8-BA48-4C5A-8BDA-96B96689A1FC} = {D7A7C1D4-6239-4B4C-A80C-E953334A83F8}
- {12A50382-A67F-44AB-A665-56A10DE0E8E8} = {CA934242-6AB7-40F0-B433-A2D9BF10EF4A}
- {AD6A63BB-A445-4B44-A4A0-95B10279DB72} = {D530CEBF-33A3-4BCE-9887-A50F5AE789A3}
+ {C00D54A3-7AC1-4F6B-A7EF-FB865090E7D3} = {D530CEBF-33A3-4BCE-9887-A50F5AE789A3}
+ {B8143A31-EC3C-4410-AC85-9C28DA022DC8} = {D530CEBF-33A3-4BCE-9887-A50F5AE789A3}
+ {EF3290BD-E6C9-452A-AAC1-22785543F4A6} = {D530CEBF-33A3-4BCE-9887-A50F5AE789A3}
+ {9F9C412E-A2C4-446F-B306-E0ADFC3286F2} = {CA934242-6AB7-40F0-B433-A2D9BF10EF4A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FB1557E1-2F94-4540-93E5-B47698838B72}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Abstractions/HotChocolate.Stitching.Abstractions.csproj b/src/HotChocolate/Stitching/src/Stitching.Abstractions/HotChocolate.Stitching.Abstractions.csproj
new file mode 100644
index 00000000000..61c5fe04539
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Abstractions/HotChocolate.Stitching.Abstractions.csproj
@@ -0,0 +1,16 @@
+
+
+
+ HotChocolate.Stitching.Abstractions
+ HotChocolate.Stitching.Abstractions
+ HotChocolate.Stitching
+ Contains the Hot Chocolate GraphQL schema stitching abstractions.
+ enable
+
+
+
+
+
+
+
+
diff --git a/src/HotChocolate/Stitching/src/Stitching.Abstractions/PublicAPI.Shipped.txt b/src/HotChocolate/Stitching/src/Stitching.Abstractions/PublicAPI.Shipped.txt
new file mode 100644
index 00000000000..1aefa98e667
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Abstractions/PublicAPI.Shipped.txt
@@ -0,0 +1,6 @@
+#nullable enable
+HotChocolate.Stitching.RemoteSchemaDefinition
+HotChocolate.Stitching.RemoteSchemaDefinition.Document.get -> HotChocolate.Language.DocumentNode!
+HotChocolate.Stitching.RemoteSchemaDefinition.ExtensionDocuments.get -> System.Collections.Generic.IReadOnlyList!
+HotChocolate.Stitching.RemoteSchemaDefinition.Name.get -> HotChocolate.NameString
+HotChocolate.Stitching.RemoteSchemaDefinition.RemoteSchemaDefinition(HotChocolate.NameString name, HotChocolate.Language.DocumentNode! document, System.Collections.Generic.IEnumerable? extensionDocuments = null) -> void
diff --git a/src/HotChocolate/Stitching/src/Stitching.Abstractions/PublicAPI.Unshipped.txt b/src/HotChocolate/Stitching/src/Stitching.Abstractions/PublicAPI.Unshipped.txt
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/src/HotChocolate/Stitching/src/Stitching.Abstractions/RemoteSchemaDefinition.cs b/src/HotChocolate/Stitching/src/Stitching.Abstractions/RemoteSchemaDefinition.cs
new file mode 100644
index 00000000000..c018077a9d6
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Abstractions/RemoteSchemaDefinition.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using HotChocolate.Language;
+
+namespace HotChocolate.Stitching
+{
+ ///
+ /// Defines a remote schema and how it shall be stitched into the Hot Chocolate gateway.
+ ///
+ public class RemoteSchemaDefinition
+ {
+ public RemoteSchemaDefinition(
+ string name,
+ DocumentNode document,
+ IEnumerable? extensionDocuments = null)
+ {
+ Name = name;
+ Document = document;
+ ExtensionDocuments = extensionDocuments?.ToArray() ?? Array.Empty();
+ }
+
+ ///
+ /// Gets the name of the schema.
+ ///
+ public string Name { get; }
+
+ ///
+ /// Gets the main schema documents.
+ ///
+ public DocumentNode Document { get; }
+
+ ///
+ /// Gets the documents that describes how type are being merged
+ /// into types from other services.
+ ///
+ public IReadOnlyList ExtensionDocuments { get; }
+ }
+}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Redis/DependencyInjection/HotChocolateStitchingRedisPublishSchemaDefinitionDescriptorExtensions.cs b/src/HotChocolate/Stitching/src/Stitching.Redis/DependencyInjection/HotChocolateStitchingRedisPublishSchemaDefinitionDescriptorExtensions.cs
new file mode 100644
index 00000000000..f9b069d9fa1
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Redis/DependencyInjection/HotChocolateStitchingRedisPublishSchemaDefinitionDescriptorExtensions.cs
@@ -0,0 +1,31 @@
+using System;
+using HotChocolate;
+using HotChocolate.Stitching.Redis;
+using HotChocolate.Stitching.SchemaDefinitions;
+using HotChocolate.Utilities;
+using StackExchange.Redis;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public static class HotChocolateStitchingRedisPublishSchemaDefinitionDescriptorExtensions
+ {
+ public static IPublishSchemaDefinitionDescriptor PublishToRedis(
+ this IPublishSchemaDefinitionDescriptor descriptor,
+ string configurationName,
+ Func connectionFactory)
+ {
+ if (connectionFactory is null)
+ {
+ throw new ArgumentNullException(nameof(connectionFactory));
+ }
+
+ configurationName.EnsureGraphQLName(nameof(configurationName));
+
+ return descriptor.SetSchemaDefinitionPublisher(sp =>
+ {
+ var connection = connectionFactory(sp);
+ return new RedisSchemaDefinitionPublisher(configurationName, connection);
+ });
+ }
+ }
+}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Redis/DependencyInjection/HotChocolateStitchingRedisRequestExecutorBuilderExtensions.cs b/src/HotChocolate/Stitching/src/Stitching.Redis/DependencyInjection/HotChocolateStitchingRedisRequestExecutorBuilderExtensions.cs
new file mode 100644
index 00000000000..4e0f69cc9f3
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Redis/DependencyInjection/HotChocolateStitchingRedisRequestExecutorBuilderExtensions.cs
@@ -0,0 +1,41 @@
+using Microsoft.Extensions.DependencyInjection.Extensions;
+using HotChocolate.Execution.Configuration;
+using HotChocolate.Stitching.Redis;
+using HotChocolate.Stitching.Requests;
+using HotChocolate.Utilities;
+using StackExchange.Redis;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public static class HotChocolateStitchingRedisRequestExecutorBuilderExtensions
+ {
+ public static IRequestExecutorBuilder AddRemoteSchemasFromRedis(
+ this IRequestExecutorBuilder builder,
+ string configurationName,
+ Func connectionFactory)
+ {
+ if (connectionFactory is null)
+ {
+ throw new ArgumentNullException(nameof(connectionFactory));
+ }
+
+ configurationName.EnsureGraphQLName(nameof(configurationName));
+
+ builder.Services.AddSingleton(sp =>
+ {
+ var connection = connectionFactory(sp);
+ var database = connection.GetDatabase();
+ var subscriber = connection.GetSubscriber();
+ return new RedisExecutorOptionsProvider(
+ builder.Name, configurationName, database, subscriber);
+ });
+
+ // Last but not least, we will setup the stitching context which will
+ // provide access to the remote executors which in turn use the just configured
+ // request executor proxies to send requests to the downstream services.
+ builder.Services.TryAddScoped();
+
+ return builder;
+ }
+ }
+}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Redis/HotChocolate.Stitching.Redis.csproj b/src/HotChocolate/Stitching/src/Stitching.Redis/HotChocolate.Stitching.Redis.csproj
new file mode 100644
index 00000000000..b669186bb6b
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Redis/HotChocolate.Stitching.Redis.csproj
@@ -0,0 +1,20 @@
+
+
+
+ HotChocolate.Stitching.Redis
+ HotChocolate.Stitching.Redis
+ Contains the Hot Chocolate GraphQL schema stitching layer.
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/HotChocolate/Stitching/src/Stitching.Redis/PublicAPI.Shipped.txt b/src/HotChocolate/Stitching/src/Stitching.Redis/PublicAPI.Shipped.txt
new file mode 100644
index 00000000000..992014cdf83
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Redis/PublicAPI.Shipped.txt
@@ -0,0 +1,8 @@
+#nullable enable
+HotChocolate.Stitching.Redis.RedisSchemaDefinitionPublisher
+HotChocolate.Stitching.Redis.RedisSchemaDefinitionPublisher.PublishAsync(HotChocolate.Stitching.RemoteSchemaDefinition! schemaDefinition, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask
+HotChocolate.Stitching.Redis.RedisSchemaDefinitionPublisher.RedisSchemaDefinitionPublisher(HotChocolate.NameString configurationName, StackExchange.Redis.IConnectionMultiplexer! connection) -> void
+Microsoft.Extensions.DependencyInjection.HotChocolateStitchingRedisPublishSchemaDefinitionDescriptorExtensions
+Microsoft.Extensions.DependencyInjection.HotChocolateStitchingRedisRequestExecutorBuilderExtensions
+static Microsoft.Extensions.DependencyInjection.HotChocolateStitchingRedisPublishSchemaDefinitionDescriptorExtensions.PublishToRedis(this HotChocolate.Stitching.SchemaDefinitions.IPublishSchemaDefinitionDescriptor! descriptor, HotChocolate.NameString configurationName, System.Func! connectionFactory) -> HotChocolate.Stitching.SchemaDefinitions.IPublishSchemaDefinitionDescriptor!
+static Microsoft.Extensions.DependencyInjection.HotChocolateStitchingRedisRequestExecutorBuilderExtensions.AddRemoteSchemasFromRedis(this HotChocolate.Execution.Configuration.IRequestExecutorBuilder! builder, HotChocolate.NameString configurationName, System.Func! connectionFactory) -> HotChocolate.Execution.Configuration.IRequestExecutorBuilder!
diff --git a/src/HotChocolate/Stitching/src/Stitching.Redis/PublicAPI.Unshipped.txt b/src/HotChocolate/Stitching/src/Stitching.Redis/PublicAPI.Unshipped.txt
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/src/HotChocolate/Stitching/src/Stitching.Redis/RedisExecutorOptionsProvider.cs b/src/HotChocolate/Stitching/src/Stitching.Redis/RedisExecutorOptionsProvider.cs
new file mode 100644
index 00000000000..4154c9c4d84
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Redis/RedisExecutorOptionsProvider.cs
@@ -0,0 +1,170 @@
+using System.Text.Json;
+using Microsoft.Extensions.DependencyInjection;
+using HotChocolate.Execution.Configuration;
+using HotChocolate.Language;
+using StackExchange.Redis;
+
+namespace HotChocolate.Stitching.Redis
+{
+ internal class RedisExecutorOptionsProvider : IRequestExecutorOptionsProvider
+ {
+ private readonly string _schemaName;
+ private readonly string _configurationName;
+ private readonly IDatabase _database;
+ private readonly List _listeners = new();
+
+ public RedisExecutorOptionsProvider(
+ string schemaName,
+ string configurationName,
+ IDatabase database,
+ ISubscriber subscriber)
+ {
+ _schemaName = schemaName;
+ _configurationName = configurationName;
+ _database = database;
+ subscriber.Subscribe(configurationName).OnMessage(OnChangeMessageAsync);
+ }
+
+ public async ValueTask> GetOptionsAsync(
+ CancellationToken cancellationToken)
+ {
+ var schemaDefinitions =
+ await GetSchemaDefinitionsAsync(cancellationToken)
+ .ConfigureAwait(false);
+
+ var factoryOptions = new List();
+
+ foreach (var schemaDefinition in schemaDefinitions)
+ {
+ await CreateFactoryOptionsAsync(
+ schemaDefinition,
+ factoryOptions,
+ cancellationToken)
+ .ConfigureAwait(false);
+ }
+
+ return factoryOptions;
+ }
+
+ public IDisposable OnChange(Action listener) =>
+ new OnChangeListener(_listeners, listener);
+
+ private async Task OnChangeMessageAsync(ChannelMessage message)
+ {
+ string schemaName = message.Message;
+
+ var schemaDefinition =
+ await GetRemoteSchemaDefinitionAsync(schemaName)
+ .ConfigureAwait(false);
+
+ var factoryOptions = new List();
+ await CreateFactoryOptionsAsync(schemaDefinition, factoryOptions, default)
+ .ConfigureAwait(false);
+
+ lock (_listeners)
+ {
+ foreach (var listener in _listeners)
+ {
+ foreach (var options in factoryOptions)
+ {
+ listener.OnChange(options);
+ }
+ }
+ }
+ }
+
+ private async ValueTask> GetSchemaDefinitionsAsync(
+ CancellationToken cancellationToken)
+ {
+ var items = await _database.SetMembersAsync(_configurationName)
+ .ConfigureAwait(false);
+
+ var schemaDefinitions = new List();
+
+ foreach (var schemaName in items.Select(t => (string)t))
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var schemaDefinition =
+ await GetRemoteSchemaDefinitionAsync(schemaName)
+ .ConfigureAwait(false);
+
+ schemaDefinitions.Add(schemaDefinition);
+ }
+
+ return schemaDefinitions;
+ }
+
+ private async Task CreateFactoryOptionsAsync(
+ RemoteSchemaDefinition schemaDefinition,
+ IList factoryOptions,
+ CancellationToken cancellationToken)
+ {
+ await using var services =
+ new ServiceCollection()
+ .AddGraphQL(_schemaName)
+ .AddRemoteSchema(
+ schemaDefinition.Name,
+ (_, _) => new ValueTask(schemaDefinition))
+ .Services
+ .BuildServiceProvider();
+
+ var optionsMonitor =
+ services.GetRequiredService();
+
+ var options =
+ await optionsMonitor.GetAsync(schemaDefinition.Name, cancellationToken)
+ .ConfigureAwait(false);
+
+ factoryOptions.Add(new ConfigureRequestExecutorSetup(schemaDefinition.Name, options));
+
+ options =
+ await optionsMonitor.GetAsync(_schemaName, cancellationToken)
+ .ConfigureAwait(false);
+
+ factoryOptions.Add(new ConfigureRequestExecutorSetup(_schemaName, options));
+ }
+
+ private async Task GetRemoteSchemaDefinitionAsync(string schemaName)
+ {
+ var key = $"{_configurationName}.{schemaName}";
+ var json = (byte[])await _database.StringGetAsync(key).ConfigureAwait(false);
+ var dto = JsonSerializer.Deserialize(json);
+
+ return new RemoteSchemaDefinition(
+ dto.Name,
+ Utf8GraphQLParser.Parse(dto.Document),
+ dto.ExtensionDocuments.Select(Utf8GraphQLParser.Parse));
+ }
+
+ private sealed class OnChangeListener : IDisposable
+ {
+ private readonly List _listeners;
+ private readonly Action _onChange;
+
+ public OnChangeListener(
+ List listeners,
+ Action onChange)
+ {
+ _listeners = listeners;
+ _onChange = onChange;
+
+ lock (_listeners)
+ {
+ _listeners.Add(this);
+ }
+ }
+
+ public void OnChange(IConfigureRequestExecutorSetup options) =>
+ _onChange(options);
+
+ public void Dispose()
+ {
+ lock (_listeners)
+ {
+ _listeners.Remove(this);
+ }
+ }
+ }
+ }
+}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Redis/RedisSchemaDefinitionPublisher.cs b/src/HotChocolate/Stitching/src/Stitching.Redis/RedisSchemaDefinitionPublisher.cs
new file mode 100644
index 00000000000..e17f8699170
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Redis/RedisSchemaDefinitionPublisher.cs
@@ -0,0 +1,50 @@
+using System.Text.Json;
+using HotChocolate.Stitching.SchemaDefinitions;
+using StackExchange.Redis;
+
+namespace HotChocolate.Stitching.Redis;
+
+public class RedisSchemaDefinitionPublisher : ISchemaDefinitionPublisher
+{
+ private readonly IConnectionMultiplexer _connection;
+ private readonly string _configurationName;
+
+ public RedisSchemaDefinitionPublisher(
+ string configurationName,
+ IConnectionMultiplexer connection)
+ {
+ _connection = connection;
+ _configurationName = configurationName;
+ }
+
+ public async ValueTask PublishAsync(
+ RemoteSchemaDefinition schemaDefinition,
+ CancellationToken cancellationToken = default)
+ {
+ var key = $"{_configurationName}.{schemaDefinition.Name}";
+ var json = SerializeSchemaDefinition(schemaDefinition);
+
+ var database = _connection.GetDatabase();
+ await database.StringSetAsync(key, json).ConfigureAwait(false);
+ await database.SetAddAsync(_configurationName, schemaDefinition.Name)
+ .ConfigureAwait(false);
+
+ var subscriber = _connection.GetSubscriber();
+ await subscriber.PublishAsync(_configurationName, schemaDefinition.Name)
+ .ConfigureAwait(false);
+ }
+
+ private string SerializeSchemaDefinition(RemoteSchemaDefinition schemaDefinition)
+ {
+ var dto = new SchemaDefinitionDto
+ {
+ Name = schemaDefinition.Name,
+ Document = schemaDefinition.Document.ToString(false),
+ };
+
+ dto.ExtensionDocuments.AddRange(
+ schemaDefinition.ExtensionDocuments.Select(t => t.ToString()).ToList());
+
+ return JsonSerializer.Serialize(dto);
+ }
+}
diff --git a/src/HotChocolate/Stitching/src/Stitching.Redis/SchemaDefinitionDto.cs b/src/HotChocolate/Stitching/src/Stitching.Redis/SchemaDefinitionDto.cs
new file mode 100644
index 00000000000..d053bcf0c06
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching.Redis/SchemaDefinitionDto.cs
@@ -0,0 +1,13 @@
+using System.Collections.Generic;
+
+namespace HotChocolate.Stitching.Redis
+{
+ internal sealed class SchemaDefinitionDto
+ {
+ public string? Name { get; set; }
+
+ public string? Document { get; set; }
+
+ public List ExtensionDocuments { get; set; } = new List();
+ }
+}
diff --git a/src/HotChocolate/Stitching/src/Stitching/Delegation/CollectUsedVariableVisitor.cs b/src/HotChocolate/Stitching/src/Stitching/Delegation/CollectUsedVariableVisitor.cs
new file mode 100644
index 00000000000..83fec07d52f
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching/Delegation/CollectUsedVariableVisitor.cs
@@ -0,0 +1,31 @@
+using System.Collections.Generic;
+using HotChocolate.Language;
+
+namespace HotChocolate.Stitching.Delegation;
+
+internal class CollectUsedVariableVisitor : QuerySyntaxWalker>
+{
+ public void CollectUsedVariables(
+ FieldNode fieldNode,
+ ISet usedVariables)
+ {
+ VisitField(fieldNode, usedVariables);
+ }
+
+ public void CollectUsedVariables(
+ IEnumerable fragmentDefinitions,
+ ISet usedVariables)
+ {
+ foreach (var fragmentDefinition in
+ fragmentDefinitions)
+ {
+ VisitFragmentDefinition(fragmentDefinition, usedVariables);
+ }
+ }
+
+ protected override void VisitVariable(
+ VariableNode node, ISet context)
+ {
+ context.Add(node.Name.Value);
+ }
+}
diff --git a/src/HotChocolate/Stitching/src/Stitching/Delegation/DelegateToRemoteSchemaMiddleware.cs b/src/HotChocolate/Stitching/src/Stitching/Delegation/DelegateToRemoteSchemaMiddleware.cs
new file mode 100644
index 00000000000..a7c02fc82d6
--- /dev/null
+++ b/src/HotChocolate/Stitching/src/Stitching/Delegation/DelegateToRemoteSchemaMiddleware.cs
@@ -0,0 +1,512 @@
+using System.Buffers;
+using System.Collections;
+using System.Collections.Immutable;
+using System.Globalization;
+using HotChocolate.Execution;
+using HotChocolate.Language;
+using HotChocolate.Resolvers;
+using HotChocolate.Stitching.Delegation.ScopedVariables;
+using HotChocolate.Stitching.Requests;
+using HotChocolate.Stitching.Utilities;
+using HotChocolate.Types;
+using static HotChocolate.Stitching.WellKnownContextData;
+using static HotChocolate.Stitching.Properties.StitchingResources;
+
+namespace HotChocolate.Stitching.Delegation;
+
+public sealed class DelegateToRemoteSchemaMiddleware
+{
+ private const string _remoteErrorField = "remote";
+ private const string _schemaNameErrorField = "schemaName";
+
+ private static readonly RootScopedVariableResolver _resolvers = new();
+
+ private readonly FieldDelegate _next;
+
+ public DelegateToRemoteSchemaMiddleware(FieldDelegate next)
+ {
+ _next = next ?? throw new ArgumentNullException(nameof(next));
+ }
+
+ public async Task InvokeAsync(IMiddlewareContext context)
+ {
+ var delegateDirective = context.Selection
+ .Field
+ .Directives[DirectiveNames.Delegate]
+ .FirstOrDefault()?.ToObject();
+
+ if (delegateDirective != null)
+ {
+ IImmutableStack path;
+ IImmutableStack reversePath;
+
+ if (delegateDirective.Path is null)
+ {
+ path = ImmutableStack.Empty;
+ reversePath = ImmutableStack.Empty;
+ }
+ else
+ {
+ path = SelectionPathParser.Parse(delegateDirective.Path);
+ reversePath = ImmutableStack.CreateRange(path);
+ }
+
+ var request = CreateQuery(context, delegateDirective.Schema, path, reversePath);
+
+ var result = await ExecuteQueryAsync(context, request, delegateDirective.Schema)
+ .ConfigureAwait(false);
+ context.RegisterForCleanup(result.DisposeAsync, cleanAfter: CleanAfter.Request);
+
+ UpdateContextData(context, result, delegateDirective);
+
+ var value = ExtractData(result.Data, reversePath, context.ResponseName);
+ context.Result = value is null or NullValueNode ? null : new SerializedData(value);
+ if (result.Errors is not null)
+ {
+ ReportErrors(delegateDirective.Schema, context, path, result.Errors);
+ }
+ }
+
+ await _next.Invoke(context).ConfigureAwait(false);
+ }
+
+ private static void UpdateContextData(
+ IResolverContext context,
+ IQueryResult result,
+ DelegateDirective delegateDirective)
+ {
+ if (result.ContextData is { Count: > 0 })
+ {
+ var builder = ImmutableDictionary.CreateBuilder();
+ builder.AddRange(context.ScopedContextData);
+ builder[SchemaName] = delegateDirective.Schema;
+ builder.AddRange(result.ContextData);
+ context.ScopedContextData = builder.ToImmutableDictionary();
+ }
+ else
+ {
+ context.SetScopedState(SchemaName, delegateDirective.Schema);
+ }
+ }
+
+ private static IQueryRequest CreateQuery(
+ IMiddlewareContext context,
+ string schemaName,
+ IImmutableStack path,
+ IImmutableStack reversePath)
+ {
+ var fieldRewriter = new ExtractFieldQuerySyntaxRewriter(
+ context.Schema,
+ context.Service>());
+
+ var operationType =
+ context.Schema.IsRootType(context.ObjectType)
+ ? context.Operation.Type
+ : OperationType.Query;
+
+ var extractedField = fieldRewriter.ExtractField(
+ schemaName, context.Operation.Document, context.Operation.Definition,
+ context.Selection, context.ObjectType);
+
+ IEnumerable scopedVariables =
+ ResolveScopedVariables(
+ context, schemaName, operationType,
+ reversePath, fieldRewriter);
+
+ var variableValues =
+ CreateVariableValues(
+ context, schemaName, scopedVariables,
+ extractedField, fieldRewriter);
+
+ var builder =
+ RemoteQueryBuilder.New()
+ .SetRequestField(extractedField.SyntaxNodes[0])
+ .SetOperation(context.Operation.Definition.Name, operationType)
+ .SetSelectionPath(path)
+ .AddVariables(CreateVariableDefs(variableValues))
+ .AddFragmentDefinitions(extractedField.Fragments);
+
+ if (extractedField.SyntaxNodes.Count > 1)
+ {
+ for (var i = 1; i < extractedField.SyntaxNodes.Count; i++)
+ {
+ builder.AddAdditionalField(extractedField.SyntaxNodes[i]);
+ }
+ }
+
+ var query = builder.Build(schemaName, context.Schema.GetNameLookup());
+
+ var requestBuilder = QueryRequestBuilder.New();
+
+ AddVariables(requestBuilder, query, variableValues);
+
+ requestBuilder
+ .SetQuery(query)
+ .AddGlobalState(IsAutoGenerated, true);
+
+ return requestBuilder.Create();
+ }
+
+ private static async Task ExecuteQueryAsync(
+ IResolverContext context,
+ IQueryRequest request,
+ string schemaName)
+ {
+ var stitchingContext = context.Service();
+ var executor = stitchingContext.GetRemoteRequestExecutor(schemaName);
+ var result = await executor.ExecuteAsync(request).ConfigureAwait(false);
+
+ if (result is IQueryResult queryResult)
+ {
+ return queryResult;
+ }
+
+ throw new GraphQLException(DelegationMiddleware_OnlyQueryResults);
+ }
+
+ private static object? ExtractData(
+ IReadOnlyDictionary? data,
+ IImmutableStack reversePath,
+ string fieldName)
+ {
+ if (data is null || data.Count == 0)
+ {
+ return null;
+ }
+
+ if (reversePath.IsEmpty)
+ {
+ return data.First().Value;
+ }
+
+ object? current = data;
+
+ while (!reversePath.IsEmpty && current is not null)
+ {
+ reversePath = reversePath.Pop(out var component);
+
+ if (current is IReadOnlyDictionary obj)
+ {
+ if (reversePath.IsEmpty)
+ {
+ current = obj.First().Value;
+ }
+ else
+ {
+ obj.TryGetValue(component.Name.Value, out current);
+ }
+ }
+ else if (current is IList list)
+ {
+ var aggregated = new List