Skip to content

Commit

Permalink
demo: Legacy property queries
Browse files Browse the repository at this point in the history
  • Loading branch information
nikcio committed Sep 8, 2022
1 parent 341fe62 commit d5d2610
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
12 changes: 12 additions & 0 deletions test/v10/Models/Custom2ContentQuery.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using HotChocolate.Types;
using Nikcio.UHeadless.Content.Basics.Models;
using Nikcio.UHeadless.Content.Queries;
using Nikcio.UHeadless.Core.GraphQL.Queries;

namespace v10.Models
{
[ExtendObjectType(typeof(Query))]
public class Custom2ContentQuery : ContentQuery<BasicContent<CustomProperty>, CustomProperty, BasicContentRedirect>
{
}
}
19 changes: 19 additions & 0 deletions test/v10/Models/CustomProperty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using HotChocolate.Types;
using HotChocolate;
using Nikcio.UHeadless.Base.Properties.Commands;
using Nikcio.UHeadless.Base.Properties.Factories;
using Nikcio.UHeadless.Base.Properties.Models;
using Nikcio.UHeadless.Basics.Properties.Models;

namespace v10.Models
{
public class CustomProperty : BasicProperty
{
public CustomProperty(CreateProperty createProperty, IPropertyValueFactory propertyValueFactory) : base(createProperty, propertyValueFactory)
{
}

[GraphQLType(typeof(AnyType))]
public override PropertyValue? Value => base.Value;
}
}
2 changes: 1 addition & 1 deletion test/v10/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void ConfigureServices(IServiceCollection services)
{
GraphQLExtensions = (IRequestExecutorBuilder builder) =>
{
builder.AddTypeExtension<CustomContentQuery>();
builder.AddTypeExtension<Custom2ContentQuery>();
builder.AddTypeExtension<BasicPropertyQuery>();
builder.AddTypeExtension<BasicMediaQuery>();
builder.AddTypeExtension<BasicMemberQuery>();
Expand Down

0 comments on commit d5d2610

Please sign in to comment.