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

chore(graphql): Upgrade to HotChocolate v15 #1640

Merged
merged 8 commits into from
Feb 5, 2025
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
8 changes: 8 additions & 0 deletions docs/schema/V1/schema.verified.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,13 @@ enum ActorType {
SERVICE_OWNER
}

"Defines when a policy shall be executed."
enum ApplyPolicy {
"Before the resolver was executed."
BEFORE_RESOLVER
"After the resolver was executed."
AFTER_RESOLVER
"The policy is applied in the validation step before the execution."
VALIDATION
}

Expand Down Expand Up @@ -451,8 +455,12 @@ enum TransmissionType {
CORRECTION
}

"The authorize directive."
directive @authorize("The name of the authorization policy that determines access to the annotated resource." policy: String "Roles that are allowed to access the annotated resource." roles: [String!] "Defines when when the authorize directive shall be applied.By default the authorize directives are applied during the validation phase." apply: ApplyPolicy! = BEFORE_RESOLVER) repeatable on OBJECT | FIELD_DEFINITION

"The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions."
directive @specifiedBy("The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types." url: String!) on SCALAR

"The `DateTime` scalar represents an ISO-8601 compliant date time type."
scalar DateTime @specifiedBy(url: "https:\/\/www.graphql-scalars.com\/date-time")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<ItemGroup>
<PackageReference Include="AppAny.HotChocolate.FluentValidation" Version="0.11.2" />
<PackageReference Include="AppAny.HotChocolate.FluentValidation" Version="0.12.0" />
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0"/>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.1" />
<PackageReference Include="HotChocolate.AspNetCore" Version="13.9.14" />
<PackageReference Include="HotChocolate.Diagnostics" Version="13.9.14" />
<PackageReference Include="HotChocolate.Data.EntityFramework" Version="13.9.14" />
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="13.9.14" />
<PackageReference Include="HotChocolate.AspNetCore" Version="15.0.0" />
<PackageReference Include="HotChocolate.Diagnostics" Version="15.0.0" />
<PackageReference Include="HotChocolate.Data.EntityFramework" Version="15.0.0" />
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="15.0.0" />
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ public static IServiceCollection AddDialogportenGraphQl(this IServiceCollection
{
return services
.AddGraphQLServer()
.ModifyCostOptions(o => o.ApplyCostDefaults = false)
// This assumes that subscriptions have been set up by the infrastructure
.AddSubscriptionType<Subscriptions>()
.AddAuthorization()
.RegisterDbContextFactory<DialogDbContext>()
.AddFluentValidation()
.RegisterDbContext<DialogDbContext>()
.AddQueryType<Queries>()
.AddMutationType<Mutations>()
.AddType<DialogByIdDeleted>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<ItemGroup>
<PackageReference Include="Altinn.ApiClients.Maskinporten" Version="9.2.1" />
<PackageReference Include="HotChocolate.Subscriptions.Redis" Version="13.9.14" />
<PackageReference Include="HotChocolate.Subscriptions.Redis" Version="15.0.0" />
<PackageReference Include="MassTransit.Azure.ServiceBus.Core" Version="8.3.5" />
<PackageReference Include="MassTransit.EntityFrameworkCore" Version="8.3.5" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.1" />
Expand Down