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

Migrated spatial types to new type system core. #2304

Merged
merged 54 commits into from
Oct 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
034baa4
integrated to main build
michaelstaib Sep 10, 2020
92a98ae
feat: spatial types
PascalSenn Sep 10, 2020
dc9a4ed
feat: undo namespace changes
PascalSenn Sep 10, 2020
c71f8e6
Merge branch 'pse/spatial-types' of https://github.com/ChilliCream/ho…
PascalSenn Sep 10, 2020
6acbbbd
Merge branch 'develop' into pse/spatial-types
michaelstaib Sep 11, 2020
406ba8b
Merge branch 'develop' into pse/spatial-types
PascalSenn Sep 11, 2020
492a933
feat: spatial types refactoring
PascalSenn Sep 11, 2020
5e422fe
Merge branch 'pse/spatial-types' of https://github.com/ChilliCream/ho…
PascalSenn Sep 11, 2020
2e6179b
fix build
PascalSenn Sep 11, 2020
11bf141
fix trailing whitespace
PascalSenn Sep 11, 2020
758a05d
fix static imports
PascalSenn Sep 11, 2020
6fa56ac
Merge branch 'develop' into pse/spatial-types
PascalSenn Sep 11, 2020
19d0717
Merge branch 'develop' into pse/spatial-types
michaelstaib Sep 11, 2020
b053ab2
Merge branch 'develop' into pse/spatial-types
michaelstaib Sep 11, 2020
6c81349
Merge branch 'develop' into pse/spatial-types
michaelstaib Sep 12, 2020
2eccc6e
Merge branch 'develop' into pse/spatial-types
michaelstaib Sep 14, 2020
d5567ac
Update GeoJSONPointTypeTests.cs
michaelstaib Sep 14, 2020
94951f1
fix format
PascalSenn Sep 14, 2020
0d8d7ae
Merge branch 'pse/spatial-types' of https://github.com/ChilliCream/ho…
PascalSenn Sep 14, 2020
1470b00
add parse result
PascalSenn Sep 14, 2020
7da8c4e
add exception
PascalSenn Sep 14, 2020
37ebc43
feat: refactor type name
PascalSenn Sep 15, 2020
e03a865
feat: refactor type name
PascalSenn Sep 15, 2020
d18c50b
Merge branch 'pse/spatial-types' of https://github.com/ChilliCream/ho…
PascalSenn Sep 15, 2020
9e3bac9
feat: add scalar
PascalSenn Sep 16, 2020
36922c7
Update GeometryType.cs
michaelstaib Sep 16, 2020
e8ef06e
working commit
PascalSenn Sep 18, 2020
cd96b45
working commit
PascalSenn Sep 18, 2020
8ba34a7
Merge branch 'pse/spatial-types' of https://github.com/ChilliCream/ho…
PascalSenn Sep 18, 2020
d5788b4
feat: add serializers
PascalSenn Sep 21, 2020
4ef4afe
working commit
PascalSenn Sep 24, 2020
02e94db
test: spatial types
PascalSenn Sep 25, 2020
fbb3a13
move names to constants
PascalSenn Sep 26, 2020
6353881
add more tests
PascalSenn Sep 26, 2020
0da2233
Merge branch 'develop' into pse/spatial-types
PascalSenn Sep 26, 2020
ad650a6
reastore test helper
PascalSenn Sep 26, 2020
95aff1e
update snapshots
PascalSenn Sep 26, 2020
fbda5fd
Update GeoJsonPolygonTypeTests.cs
michaelstaib Sep 26, 2020
c0fa7e0
feat: cleanup filter from localcontext
PascalSenn Sep 30, 2020
18d6b98
Merge branch 'pse/spatial-types' of https://github.com/ChilliCream/ho…
PascalSenn Sep 30, 2020
9d2aae9
fix format
PascalSenn Sep 30, 2020
11f2cba
Merge branch 'develop' into pse/spatial-types
michaelstaib Oct 3, 2020
213e14c
fixed naming inconsistencies
michaelstaib Oct 3, 2020
208d694
Added more code fixes and documentation
michaelstaib Oct 4, 2020
3e530c9
Fixed compile errors
michaelstaib Oct 4, 2020
64d759d
Fixed tests
michaelstaib Oct 4, 2020
342d207
Fixed namespace
michaelstaib Oct 4, 2020
2588cad
fixed more style issues
michaelstaib Oct 4, 2020
5efe6c6
fixed more style issues
michaelstaib Oct 4, 2020
1d1eef1
fixed more issues
michaelstaib Oct 4, 2020
096dbe5
more cleanups
michaelstaib Oct 4, 2020
bba3dcf
formatting
michaelstaib Oct 4, 2020
b580d52
formatting
michaelstaib Oct 4, 2020
eec6723
Fixed Test
michaelstaib Oct 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .build/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class Helpers
Path.Combine("HotChocolate", "PersistedQueries"),
Path.Combine("HotChocolate", "Utilities"),
Path.Combine("HotChocolate", "Data"),
Path.Combine("HotChocolate", "Filters")
Path.Combine("HotChocolate", "Filters"),
Path.Combine("HotChocolate", "Spatial")
};

public static IEnumerable<string> GetAllProjects(string sourceDirectory)
Expand Down
1 change: 0 additions & 1 deletion src/HotChocolate/Core/src/Types/Types/EnumType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,5 @@ public bool TryDeserialize(object? resultValue, out object? runtimeValue)
runtimeValue = null;
return false;
}

}
}
4 changes: 2 additions & 2 deletions src/HotChocolate/Core/src/Types/Types/Scalars/IdType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public override IValueNode ParseValue(object? runtimeValue)
{
if (runtimeValue is null)
{
return new NullValueNode(null);
return NullValueNode.Default;
}

if (runtimeValue is string s)
Expand All @@ -105,7 +105,7 @@ public override IValueNode ParseResult(object? resultValue)
{
if (resultValue is null)
{
return new NullValueNode(null);
return NullValueNode.Default;
}

if (resultValue is string s)
Expand Down
4 changes: 2 additions & 2 deletions src/HotChocolate/Core/test/Utilities/TestHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using HotChocolate.Execution;
Expand Down Expand Up @@ -203,4 +203,4 @@ public static void AddDefaultConfiguration(IRequestExecutorBuilder builder)
.AddStarWarsRepositories();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq.Expressions;
using HotChocolate.Language;
using HotChocolate.Types.Descriptors;
using HotChocolate.Utilities;

namespace HotChocolate.Data.Filters.Expressions
Expand Down Expand Up @@ -32,11 +33,9 @@ public class QueryableComparableInHandler
}

return FilterExpressionBuilder.In(
property,
context.RuntimeTypes.Peek().Source,
parsedValue);

throw new InvalidOperationException();
property,
context.RuntimeTypes.Peek().Source,
parsedValue);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace HotChocolate.Data.Filters.Expressions
public class QueryableFilterProvider
: FilterProvider<QueryableFilterContext>
{
public static readonly string ContextDataKeys = nameof(QueryableFilterProvider);

public QueryableFilterProvider()
{
}
Expand All @@ -36,9 +38,13 @@ public override FieldMiddleware CreateExecutor<TEntityType>(NameString argumentN
// first we let the pipeline run and produce a result.
await next(context).ConfigureAwait(false);

// next we get the filter argument.
// next we get the filter argument. If the filter argument is already on the context
// we use this. This enabled overriding the context with LocalContextData
IInputField argument = context.Field.Arguments[argumentName];
IValueNode filter = context.ArgumentLiteral<IValueNode>(argumentName);
IValueNode filter = context.LocalContextData.ContainsKey(ContextDataKeys) &&
context.LocalContextData[ContextDataKeys] is IValueNode node
? node
: context.ArgumentLiteral<IValueNode>(argumentName);

// if no filter is defined we can stop here and yield back control.
if (filter.IsNull())
Expand All @@ -60,7 +66,8 @@ public override FieldMiddleware CreateExecutor<TEntityType>(NameString argumentN
if (source != null && argument.Type is IFilterInputType filterInput)
{
var visitorContext = new QueryableFilterContext(
filterInput, source is EnumerableQuery);
filterInput,
source is EnumerableQuery);

// rewrite GraphQL input object into expression tree.
Visitor.Visit(filter, visitorContext);
Expand Down
289 changes: 289 additions & 0 deletions src/HotChocolate/Spatial/HotChocolate.Spatial.sln

Large diffs are not rendered by default.

453 changes: 0 additions & 453 deletions src/HotChocolate/Spatial/SpatialTypes.sln

This file was deleted.

18 changes: 0 additions & 18 deletions src/HotChocolate/Spatial/demo/Directory.Build.props

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

111 changes: 0 additions & 111 deletions src/HotChocolate/Spatial/demo/Types.Spatial.Playground/GeoQueries.cs

This file was deleted.

26 changes: 0 additions & 26 deletions src/HotChocolate/Spatial/demo/Types.Spatial.Playground/Program.cs

This file was deleted.