Skip to content

Commit

Permalink
Merge branch 'main' into spec-graphql-https
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib authored Dec 13, 2023
2 parents fb2d1f8 + 2ab1a70 commit f75a496
Show file tree
Hide file tree
Showing 114 changed files with 2,579 additions and 343 deletions.
1 change: 1 addition & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"traversion",
"Websockets",
"Newtonsoft",
"supergraph",
"cachable",
"fricking",
"runtimes",
Expand Down
2 changes: 1 addition & 1 deletion src/CookieCrumble/src/CookieCrumble/LocalFactDiscoverer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace CookieCrumble;

[XunitTestCaseDiscoverer("LocalFactDiscoverer", "YourTestAssemblyName")]
public class LocalFactAttribute : FactAttribute { }
public class LocalFactAttribute : FactAttribute;

public class LocalFactDiscoverer : FactDiscoverer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ internal static void WriteFieldValue(
case Dictionary<string, object?> dict:
WriteDictionary(writer, dict);
break;

case byte[] bytes:
writer.WriteBase64StringValue(bytes);
break;

case IList list:
WriteList(writer, list);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ namespace HotChocolate;
/// </summary>
[Obsolete("Use [Service(ServiceKind.Pooled)] or [Service(ServiceKind.Resolver)]")]
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class ScopedServiceAttribute : Attribute { }
public sealed class ScopedServiceAttribute : Attribute;
2 changes: 1 addition & 1 deletion src/HotChocolate/Core/src/Abstractions/Types/IInputType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ namespace HotChocolate.Types;
///
/// Spec: https://spec.graphql.org/draft/#sec-Input-and-Output-Types
/// </summary>
public interface IInputType : IType, IHasRuntimeType { }
public interface IInputType : IType, IHasRuntimeType;
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ namespace HotChocolate.Types;
/// This marker interface identifies member of the type system like
/// types, directives, the schema or fields and arguments.
/// </summary>
public interface ITypeSystemMember { }
public interface ITypeSystemMember;
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ public interface IRequestExecutorOptionsAccessor
: IErrorHandlerOptionsAccessor
, IRequestTimeoutOptionsAccessor
, IComplexityAnalyzerOptionsAccessor
, IPersistedQueryOptionsAccessor
{ }
, IPersistedQueryOptionsAccessor;
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,4 @@ private static T CreateDataLoader<T>(IServiceProvider services)
}
}

internal sealed class GetDataLoaderAttribute : Attribute { }
internal sealed class GetDataLoaderAttribute : Attribute;
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ namespace HotChocolate.Subscriptions.Diagnostics;
/// and they will all be notified in the registration order.
/// </summary>
/// <seealso cref="SubscriptionDiagnosticEventsListener"/>
public interface ISubscriptionDiagnosticEventsListener : ISubscriptionDiagnosticEvents { }
public interface ISubscriptionDiagnosticEventsListener : ISubscriptionDiagnosticEvents;
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ namespace HotChocolate.Types.Relay;
/// This attribute marks the node resolver in a relay node type.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public sealed class NodeResolverAttribute : Attribute { }
public sealed class NodeResolverAttribute : Attribute;
Original file line number Diff line number Diff line change
Expand Up @@ -2689,13 +2689,13 @@ void Error()
Assert.Throws<ArgumentException>(Error);
}

public class ErrorObj1 { }
public class ErrorObj1;

public class ErrorObj2 { }
public class ErrorObj2;

public class ErrorObj3 { }
public class ErrorObj3;

public class ErrorObj4 { }
public class ErrorObj4;

public class ErrorObj5 { }
public class ErrorObj5;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ public sealed record Street(string? Value) : ICityOrStreet;
public sealed record City(string? Value) : ICityOrStreet;

[UnionType]
public interface ICityOrStreet { }
public interface ICityOrStreet;

[Node]
[ExtendObjectType<Street>]
Expand Down Expand Up @@ -1090,7 +1090,7 @@ public ValueTask<AuthorizeResult> AuthorizeAsync(
}

[DirectiveType(DirectiveLocation.Object)]
public sealed class FooDirective { }
public sealed class FooDirective;

public sealed class FooDirectiveAttribute : ObjectTypeDescriptorAttribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ private sealed record Street(string? Value) : ICityOrStreet;

private sealed record City(string? Value) : ICityOrStreet;

private interface ICityOrStreet { }
private interface ICityOrStreet;

private sealed class AuthHandler : IAuthorizationHandler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public IError OnError(IError error)
}
}

public class SomeService { }
public class SomeService;

public class AggregateErrorFilter : IErrorFilter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ protected override void Configure(IDirectiveTypeDescriptor<Resolve> descriptor)
}
}

public sealed class Resolve { }
public sealed class Resolve;
}
4 changes: 2 additions & 2 deletions src/HotChocolate/Core/test/Types.Analyzers.Tests/SomeQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ public static Task<string> GetGenericById(
}
}

public class SomeService { }
public class SomeService;

public class GenericService<T> { }
public class GenericService<T>;
Original file line number Diff line number Diff line change
Expand Up @@ -288,5 +288,5 @@ public class QueryWithInferError2
public string Foo(IMyArg o) => throw new NotImplementedException();
}

public interface IMyArg { }
public interface IMyArg;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<AssemblyName>HotChocolate.Types.Tests</AssemblyName>
<RootNamespace>HotChocolate</RootNamespace>
<LangVersion>Preview</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,5 +619,5 @@ public class Nullability

#nullable disable

public class Foo { }
public class Foo;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1527,9 +1527,9 @@ public string SetLocalState(
}
}

public class Entity { }
public class Entity;

public class MyService { }
public class MyService;

public class QueryWithScopedExpressionBuilder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,7 @@ protected override void Configure(ISchemaTypeDescriptor descriptor)
}
}

public class MyEnumType : EnumType { }
public class MyEnumType : EnumType;

public class QueryWithIntField
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ public enum Foo
Bar2
}

public class Bar { }
public class Bar;

public enum FooObsolete
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ protected override void Configure(
}
}

public class FooDirective { }
public class FooDirective;

public class QueryType : ObjectType
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2267,8 +2267,7 @@ public class FooWithDict
}

public class MyList
: MyListBase
{ }
: MyListBase;

public class MyListBase
: IQueryable<Bar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public void UnionTypeAttribute_Infer_Union()
}

[SetName]
public interface IUnion1 { }
public interface IUnion1;

public class Foo : IUnion1 { }
public class Foo : IUnion1;

public class SetNameAttribute : UnionTypeDescriptorAttribute
{
Expand All @@ -54,8 +54,8 @@ protected override void OnConfigure(
}

[UnionType(Name = "Union")]
public interface IUnion2 { }
public interface IUnion2;

[ObjectType(Name = "Type")]
public class Union2Type1 : IUnion2 { }
public class Union2Type1 : IUnion2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,5 @@ protected override void Configure(
}
}

public class FooDirective { }
public class FooDirective;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@

12and13 SQL:
---------------
.param set @__p_0 '[12,13]'

SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" IN (12, 13)
WHERE "d"."BarShort" IN (
SELECT "p"."value"
FROM json_each(@__p_0) AS "p"
)
---------------

13and14 Result:
Expand All @@ -39,9 +44,14 @@ WHERE "d"."BarShort" IN (12, 13)

13and14 SQL:
---------------
.param set @__p_0 '[13,14]'

SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" IN (13, 14)
WHERE "d"."BarShort" IN (
SELECT "p"."value"
FROM json_each(@__p_0) AS "p"
)
---------------

nullAnd14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@

12and13 SQL:
---------------
.param set @__p_0 '[12,13]'

SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" NOT IN (12, 13)
WHERE "d"."BarShort" NOT IN (
SELECT "p"."value"
FROM json_each(@__p_0) AS "p"
)
---------------

13and14 Result:
Expand All @@ -33,9 +38,14 @@ WHERE "d"."BarShort" NOT IN (12, 13)

13and14 SQL:
---------------
.param set @__p_0 '[13,14]'

SELECT "d"."Id", "d"."BarDecimal", "d"."BarDouble", "d"."BarFloat", "d"."BarInt", "d"."BarLong", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" NOT IN (13, 14)
WHERE "d"."BarShort" NOT IN (
SELECT "p"."value"
FROM json_each(@__p_0) AS "p"
)
---------------

nullAnd14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@

12and13 SQL:
---------------
.param set @__p_0 '[12,13]'

SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" IN (12, 13)
WHERE EXISTS (
SELECT 1
FROM json_each(@__p_0) AS "p"
WHERE "p"."value" = "d"."BarShort" OR ("p"."value" IS NULL AND "d"."BarShort" IS NULL))
---------------

13and14 Result:
Expand All @@ -39,9 +44,14 @@ WHERE "d"."BarShort" IN (12, 13)

13and14 SQL:
---------------
.param set @__p_0 '[13,14]'

SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" IN (13, 14)
WHERE EXISTS (
SELECT 1
FROM json_each(@__p_0) AS "p"
WHERE "p"."value" = "d"."BarShort" OR ("p"."value" IS NULL AND "d"."BarShort" IS NULL))
---------------

13andNull Result:
Expand All @@ -62,7 +72,12 @@ WHERE "d"."BarShort" IN (13, 14)

13andNull SQL:
---------------
.param set @__p_0 '[13,null]'

SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" IS NULL OR "d"."BarShort" = 13
WHERE EXISTS (
SELECT 1
FROM json_each(@__p_0) AS "p"
WHERE "p"."value" = "d"."BarShort" OR ("p"."value" IS NULL AND "d"."BarShort" IS NULL))
---------------
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@

12and13 SQL:
---------------
.param set @__p_0 '[12,13]'

SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" NOT IN (12, 13) OR "d"."BarShort" IS NULL
WHERE NOT EXISTS (
SELECT 1
FROM json_each(@__p_0) AS "p"
WHERE "p"."value" = "d"."BarShort" OR ("p"."value" IS NULL AND "d"."BarShort" IS NULL))
---------------

13and14 Result:
Expand All @@ -39,9 +44,14 @@ WHERE "d"."BarShort" NOT IN (12, 13) OR "d"."BarShort" IS NULL

13and14 SQL:
---------------
.param set @__p_0 '[13,14]'

SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" NOT IN (13, 14) OR "d"."BarShort" IS NULL
WHERE NOT EXISTS (
SELECT 1
FROM json_each(@__p_0) AS "p"
WHERE "p"."value" = "d"."BarShort" OR ("p"."value" IS NULL AND "d"."BarShort" IS NULL))
---------------

13andNull Result:
Expand All @@ -62,7 +72,12 @@ WHERE "d"."BarShort" NOT IN (13, 14) OR "d"."BarShort" IS NULL

13andNull SQL:
---------------
.param set @__p_0 '[13,null]'

SELECT "d"."Id", "d"."BarShort"
FROM "Data" AS "d"
WHERE "d"."BarShort" IS NOT NULL AND "d"."BarShort" <> 13
WHERE NOT EXISTS (
SELECT 1
FROM json_each(@__p_0) AS "p"
WHERE "p"."value" = "d"."BarShort" OR ("p"."value" IS NULL AND "d"."BarShort" IS NULL))
---------------
Loading

0 comments on commit f75a496

Please sign in to comment.