Skip to content
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 @@ -95,7 +95,7 @@ protected void WriteInitializationBase(
{
Writer.WriteIndentedLine("extension.Context,");
Writer.WriteIndentedLine("descriptor,");
Writer.WriteIndentedLine("null,");
Writer.WriteIndentedLine("typeof(global::{0}),", schemaFullTypeName);

var first = true;
foreach (var attribute in attributes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ public async Task Subscription_With_Public_Subscribe_Source_Is_Not_Exposed_As_Fi
subscription.Fields.Where(f => !f.IsIntrospectionField).Select(f => f.Name).ToArray());
}

[Fact]
public async Task ObjectTypeDescriptorAttribute_Should_Receive_NonNull_Type_When_Applied_To_StaticPartial_TypeExtension()
{
// arrange
var schema = await new ServiceCollection()
.AddGraphQLServer()
.AddIntegrationTestTypes()
.AddPagingArguments()
.BuildSchemaAsync();

// act
var renamedType = schema.Types.GetType<ObjectType>("renamed_DescriptorAttributeProbe");

// assert
Assert.NotNull(renamedType);
}

[Fact]
public async Task Maps_NullOrdering_From_PagingOptions_To_PagingArguments()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,33 @@ protected override void OnConfigure(
});
}
}

public class DescriptorAttributeProbe
{
public string Name { get; set; } = "default";
}

[ObjectType<DescriptorAttributeProbe>]
[PrefixTypeName("renamed")]
public static partial class DescriptorAttributeProbeType;

public sealed class PrefixTypeNameAttribute(string prefix) : ObjectTypeDescriptorAttribute
{
public string Prefix { get; } = prefix;

protected override void OnConfigure(
IDescriptorContext context,
IObjectTypeDescriptor descriptor,
Type? type)
{
if (type is null)
{
return;
}

var capturedPrefix = Prefix;
descriptor
.Extend()
.OnBeforeCreate((_, cfg) => cfg.Name = $"{capturedPrefix}_{cfg.Name}");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ type ProductsEdge {
node: Product!
}

type renamed_DescriptorAttributeProbe {
name: String!
}

type Shape {
key: String!
name: String!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ type ProductEdge {
node: Product!
}

type renamed_DescriptorAttributeProbe {
name: String!
}

type Shape {
key: String!
name: String!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace TestNamespace
HotChocolate.Internal.ConfigurationHelper.ApplyConfiguration(
extension.Context,
descriptor,
null,
typeof(global::TestNamespace.Query),
new global::HotChocolate.Types.QueryTypeAttribute());
configuration.ConfigurationsAreApplied = true;

Expand Down
Loading
Loading