Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue where generic types would invalidly be registered. #5119

Merged
merged 1 commit into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public static Task<HttpResponseMessage> SendPostRequestAsync<TObject>(
public static Task<HttpResponseMessage> SendPostRequestAsync(
this TestServer testServer,
string requestBody,
string path = null,
string? path = null,
bool enableApolloTracing = false,
bool includeQueryPlan = false) =>
SendPostRequestAsync(
Expand All @@ -289,7 +289,7 @@ public static Task<HttpResponseMessage> SendPostRequestAsync(
this TestServer testServer,
string requestBody,
string contentType,
string path,
string? path,
bool enableApolloTracing = false,
bool includeQueryPlan = false)
{
Expand All @@ -314,11 +314,11 @@ public static Task<HttpResponseMessage> SendGetRequestAsync(
string path = null) =>
testServer.CreateClient().GetAsync($"{CreateUrl(path)}/?{query}");

public static string CreateUrl(string path)
public static string CreateUrl(string? path)
{
var url = "http://localhost:5000";

if (path != null)
if (path is not null)
{
url += "/" + path.TrimStart('/');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ public bool TryHandle(
GeneratorSyntaxContext context,
[NotNullWhen(true)] out ISyntaxInfo? syntaxInfo)
{
if (context.Node is ClassDeclarationSyntax { BaseList.Types.Count: > 0 } possibleType)
if (context.Node is ClassDeclarationSyntax
{
BaseList.Types.Count: > 0,
TypeParameterList: null
} possibleType)
{
var model = context.SemanticModel.GetDeclaredSymbol(possibleType);
if (model is { IsAbstract: false } type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ protected override void Configure(IObjectTypeDescriptor descriptor)
{
descriptor
.Name("Query");

descriptor
.Field("person")
.Type("Entity")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace HotChocolate.Types;

public class SpecialObjectType<T> : ObjectType<T>
{

}