Skip to content

Commit 1b0995e

Browse files
committed
Update tools and packages with make update and adapt code as needed by the latest version of HotChocolate, see https://chillicream.com/blog/2021/09/27/hot-chocolate-12
1 parent 349c34e commit 1b0995e

File tree

69 files changed

+831
-691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+831
-691
lines changed

backend/dotnet-tools.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
]
1010
},
1111
"dotnet-counters": {
12-
"version": "5.0.227602",
12+
"version": "5.0.248003",
1313
"commands": [
1414
"dotnet-counters"
1515
]
1616
},
1717
"dotnet-dump": {
18-
"version": "5.0.227602",
18+
"version": "5.0.248003",
1919
"commands": [
2020
"dotnet-dump"
2121
]
2222
},
2323
"dotnet-ef": {
24-
"version": "5.0.8",
24+
"version": "5.0.10",
2525
"commands": [
2626
"dotnet-ef"
2727
]
@@ -33,37 +33,37 @@
3333
]
3434
},
3535
"dotnet-script": {
36-
"version": "1.1.0",
36+
"version": "1.2.1",
3737
"commands": [
3838
"dotnet-script"
3939
]
4040
},
4141
"dotnet-trace": {
42-
"version": "5.0.227602",
42+
"version": "5.0.248003",
4343
"commands": [
4444
"dotnet-trace"
4545
]
4646
},
4747
"dotnet-gcdump": {
48-
"version": "5.0.227602",
48+
"version": "5.0.248003",
4949
"commands": [
5050
"dotnet-gcdump"
5151
]
5252
},
5353
"dotnet-sos": {
54-
"version": "5.0.227602",
54+
"version": "5.0.248003",
5555
"commands": [
5656
"dotnet-sos"
5757
]
5858
},
5959
"roslynator.dotnet.cli": {
60-
"version": "0.1.5",
60+
"version": "0.2.0",
6161
"commands": [
6262
"roslynator"
6363
]
6464
},
6565
"jetbrains.resharper.globaltools": {
66-
"version": "2021.1.4",
66+
"version": "2021.2.1",
6767
"commands": [
6868
"jb"
6969
]

backend/src/Configuration/GraphQlConfiguration.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ IWebHostEnvironment environment
3030
.AddApolloTracing(
3131
HotChocolate.Execution.Options.TracingPreference.OnDemand
3232
) // TODO Do we want or need this?
33-
.EnableRelaySupport()
33+
.AddGlobalObjectIdentification()
34+
.AddQueryFieldToMutationPayloads()
3435
.ModifyOptions(options =>
3536
{
3637
// https://github.com/ChilliCream/hotchocolate/blob/main/src/HotChocolate/Core/src/Types/Configuration/Contracts/ISchemaOptions.cs

backend/src/GraphQl/Common/OpenEndedDateTimeRangeType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IObjectTypeDescriptor<NpgsqlRange<DateTime>> descriptor
1919
descriptor
2020
.Field("from")
2121
.Type<DateTimeType>()
22-
.Resolver(context =>
22+
.Resolve(context =>
2323
{
2424
var range = context.Parent<NpgsqlRange<DateTime>>();
2525
return range.LowerBoundInfinite
@@ -31,7 +31,7 @@ IObjectTypeDescriptor<NpgsqlRange<DateTime>> descriptor
3131
descriptor
3232
.Field("to")
3333
.Type<DateTimeType>()
34-
.Resolver(context =>
34+
.Resolve(context =>
3535
{
3636
var range = context.Parent<NpgsqlRange<DateTime>>();
3737
return range.UpperBoundInfinite

backend/src/GraphQl/Components/ComponentByIdDataLoader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ public sealed class ComponentByIdDataLoader
99
{
1010
public ComponentByIdDataLoader(
1111
IBatchScheduler batchScheduler,
12+
DataLoaderOptions options,
1213
IDbContextFactory<Data.ApplicationDbContext> dbContextFactory
1314
)
1415
: base(
1516
batchScheduler,
17+
options,
1618
dbContextFactory,
1719
dbContext => dbContext.Components
1820
)

backend/src/GraphQl/Components/ComponentManufacturersByComponentIdDataLoader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ public sealed class ComponentManufacturersByComponentIdDataLoader
1010
{
1111
public ComponentManufacturersByComponentIdDataLoader(
1212
IBatchScheduler batchScheduler,
13+
DataLoaderOptions options,
1314
IDbContextFactory<Data.ApplicationDbContext> dbContextFactory
1415
)
1516
: base(
1617
batchScheduler,
18+
options,
1719
dbContextFactory,
1820
(dbContext, ids) =>
1921
dbContext.ComponentManufacturers.AsQueryable().Where(x =>

backend/src/GraphQl/Components/PendingComponentManufacturersByComponentIdDataLoader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ public sealed class PendingComponentManufacturersByComponentIdDataLoader
1010
{
1111
public PendingComponentManufacturersByComponentIdDataLoader(
1212
IBatchScheduler batchScheduler,
13+
DataLoaderOptions options,
1314
IDbContextFactory<Data.ApplicationDbContext> dbContextFactory
1415
)
1516
: base(
1617
batchScheduler,
18+
options,
1719
dbContextFactory,
1820
(dbContext, ids) =>
1921
dbContext.ComponentManufacturers.AsQueryable().Where(x =>

backend/src/GraphQl/DataFormat/DataFormatByIdDataLoader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ public sealed class DataFormatByIdDataLoader
99
{
1010
public DataFormatByIdDataLoader(
1111
IBatchScheduler batchScheduler,
12+
DataLoaderOptions options,
1213
IDbContextFactory<Data.ApplicationDbContext> dbContextFactory
1314
)
1415
: base(
1516
batchScheduler,
17+
options,
1618
dbContextFactory,
1719
dbContext => dbContext.DataFormats
1820
)

backend/src/GraphQl/Databases/DatabaseByIdDataLoader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ public sealed class DatabaseByIdDataLoader
99
{
1010
public DatabaseByIdDataLoader(
1111
IBatchScheduler batchScheduler,
12+
DataLoaderOptions options,
1213
IDbContextFactory<Data.ApplicationDbContext> dbContextFactory
1314
)
1415
: base(
1516
batchScheduler,
17+
options,
1618
dbContextFactory,
1719
dbContext => dbContext.Databases
1820
)

backend/src/GraphQl/Databases/DatabaseResolvers.cs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Text.Json.Serialization;
1010
using System.Net.Http;
1111
using System.Net.Http.Headers;
12+
using HotChocolate;
1213

1314
namespace Metabase.GraphQl.Databases
1415
{
@@ -46,7 +47,7 @@ private sealed class DataData
4647
}
4748

4849
public async Task<DataX.IData?> GetDataAsync(
49-
Data.Database database,
50+
[Parent] Data.Database database,
5051
Guid id,
5152
DateTime? timestamp,
5253
string? locale,
@@ -81,7 +82,7 @@ private sealed class OpticalDataData
8182
}
8283

8384
public async Task<DataX.OpticalData?> GetOpticalDataAsync(
84-
Data.Database database,
85+
[Parent] Data.Database database,
8586
Guid id,
8687
DateTime? timestamp,
8788
string? locale,
@@ -117,7 +118,7 @@ private sealed class HygrothermalDataData
117118
}
118119

119120
public async Task<DataX.HygrothermalData?> GetHygrothermalDataAsync(
120-
Data.Database database,
121+
[Parent] Data.Database database,
121122
Guid id,
122123
DateTime? timestamp,
123124
string? locale,
@@ -153,7 +154,7 @@ private sealed class CalorimetricDataData
153154
}
154155

155156
public async Task<DataX.CalorimetricData?> GetCalorimetricDataAsync(
156-
Data.Database database,
157+
[Parent] Data.Database database,
157158
Guid id,
158159
DateTime? timestamp,
159160
string? locale,
@@ -189,7 +190,7 @@ private sealed class PhotovoltaicDataData
189190
}
190191

191192
public async Task<DataX.PhotovoltaicData?> GetPhotovoltaicDataAsync(
192-
Data.Database database,
193+
[Parent] Data.Database database,
193194
Guid id,
194195
DateTime? timestamp,
195196
string? locale,
@@ -225,7 +226,7 @@ private sealed class AllDataData
225226
}
226227

227228
public async Task<DataX.DataConnection?> GetAllDataAsync(
228-
Data.Database database,
229+
[Parent] Data.Database database,
229230
DataX.DataPropositionInput where,
230231
DateTime? timestamp,
231232
string? locale,
@@ -269,7 +270,7 @@ private sealed class AllOpticalDataData
269270
}
270271

271272
public async Task<DataX.OpticalDataConnection?> GetAllOpticalDataAsync(
272-
Data.Database database,
273+
[Parent] Data.Database database,
273274
DataX.OpticalDataPropositionInput where,
274275
DateTime? timestamp,
275276
string? locale,
@@ -315,7 +316,7 @@ private sealed class AllHygrothermalDataData
315316

316317

317318
public async Task<DataX.HygrothermalDataConnection?> GetAllHygrothermalDataAsync(
318-
Data.Database database,
319+
[Parent] Data.Database database,
319320
DataX.HygrothermalDataPropositionInput where,
320321
DateTime? timestamp,
321322
string? locale,
@@ -361,7 +362,7 @@ private sealed class AllCalorimetricDataData
361362

362363

363364
public async Task<DataX.CalorimetricDataConnection?> GetAllCalorimetricDataAsync(
364-
Data.Database database,
365+
[Parent] Data.Database database,
365366
DataX.CalorimetricDataPropositionInput where,
366367
DateTime? timestamp,
367368
string? locale,
@@ -406,7 +407,7 @@ private sealed class AllPhotovoltaicDataData
406407
}
407408

408409
public async Task<DataX.PhotovoltaicDataConnection?> GetAllPhotovoltaicDataAsync(
409-
Data.Database database,
410+
[Parent] Data.Database database,
410411
DataX.PhotovoltaicDataPropositionInput where,
411412
DateTime? timestamp,
412413
string? locale,
@@ -451,7 +452,7 @@ private sealed class HasDataData
451452
}
452453

453454
public async Task<bool?> GetHasDataAsync(
454-
Data.Database database,
455+
[Parent] Data.Database database,
455456
DataX.DataPropositionInput where,
456457
DateTime? timestamp,
457458
string? locale,
@@ -485,7 +486,7 @@ private sealed class HasOpticalDataData
485486
}
486487

487488
public async Task<bool?> GetHasOpticalDataAsync(
488-
Data.Database database,
489+
[Parent] Data.Database database,
489490
DataX.DataPropositionInput where,
490491
DateTime? timestamp,
491492
string? locale,
@@ -519,7 +520,7 @@ private sealed class HasCalorimetricDataData
519520
}
520521

521522
public async Task<bool?> GetHasCalorimetricDataAsync(
522-
Data.Database database,
523+
[Parent] Data.Database database,
523524
DataX.DataPropositionInput where,
524525
DateTime? timestamp,
525526
string? locale,
@@ -553,7 +554,7 @@ private sealed class HasHygrothermalDataData
553554
}
554555

555556
public async Task<bool?> GetHasHygrothermalDataAsync(
556-
Data.Database database,
557+
[Parent] Data.Database database,
557558
DataX.DataPropositionInput where,
558559
DateTime? timestamp,
559560
string? locale,
@@ -587,7 +588,7 @@ private sealed class HasPhotovoltaicDataData
587588
}
588589

589590
public async Task<bool?> GetHasPhotovoltaicDataAsync(
590-
Data.Database database,
591+
[Parent] Data.Database database,
591592
DataX.DataPropositionInput where,
592593
DateTime? timestamp,
593594
string? locale,

backend/src/GraphQl/Entities/AssociationsByAssociateIdDataLoader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Threading;
55
using System.Threading.Tasks;
66
using GreenDonut;
7-
using HotChocolate.DataLoader;
87
using Microsoft.EntityFrameworkCore;
98
using Guid = System.Guid;
109

@@ -19,11 +18,12 @@ public abstract class AssociationsByAssociateIdDataLoader<TAssociation>
1918

2019
protected AssociationsByAssociateIdDataLoader(
2120
IBatchScheduler batchScheduler,
21+
DataLoaderOptions options,
2222
IDbContextFactory<Data.ApplicationDbContext> dbContextFactory,
2323
Func<Data.ApplicationDbContext, IReadOnlyList<Guid>, IQueryable<TAssociation>> getAssociations,
2424
Func<TAssociation, Guid> getAssociateId
2525
)
26-
: base(batchScheduler)
26+
: base(batchScheduler, options)
2727
{
2828
_dbContextFactory = dbContextFactory;
2929
_getAssociations = getAssociations;

0 commit comments

Comments
 (0)