Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add spatial extensions to builder (#2566)
Co-authored-by: Michael Staib <michael@chillicream.com>
- Loading branch information
1 parent
b2877e3
commit be49faa
Showing
6 changed files
with
72 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ial/src/Data/Filters/Convention/Extensions/SpatialFilterConventionDescriptorExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...e/Spatial/src/Data/Filters/Extensions/SpatialFilteringRequestExecutorBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using HotChocolate.Data.Filters; | ||
using HotChocolate.Data.Filters.Spatial; | ||
using HotChocolate.Execution.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace HotChocolate | ||
{ | ||
public static class SpatialFilteringRequestExecutorBuilderExtensions | ||
{ | ||
public static IRequestExecutorBuilder AddSpatialFiltering( | ||
this IRequestExecutorBuilder builder) | ||
{ | ||
if (builder is null) | ||
{ | ||
throw new ArgumentNullException(nameof(builder)); | ||
} | ||
|
||
return builder.ConfigureSchema(x => x.AddSpatialFiltering()); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...tChocolate/Spatial/src/Data/Filters/Extensions/SpatialFilteringSchemaBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using HotChocolate.Data.Filters; | ||
using HotChocolate.Data.Filters.Spatial; | ||
|
||
namespace HotChocolate | ||
{ | ||
public static class SpatialFilteringSchemaBuilderExtensions | ||
{ | ||
public static ISchemaBuilder AddSpatialFiltering(this ISchemaBuilder builder) | ||
{ | ||
if (builder is null) | ||
{ | ||
throw new ArgumentNullException(nameof(builder)); | ||
} | ||
|
||
return builder.AddConvention<IFilterConvention>( | ||
new FilterConventionExtension(x => x.AddSpatialDefaults())); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters