From 94ac2a77c9e09c62fc12021e310b6cac5ab3c55c Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Thu, 28 Nov 2024 10:57:52 +0100 Subject: [PATCH] Map gql schema in all environments, so the UI/Nitro can use it --- backend/LexBoxApi/Program.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/LexBoxApi/Program.cs b/backend/LexBoxApi/Program.cs index a25d36415..76c03493f 100644 --- a/backend/LexBoxApi/Program.cs +++ b/backend/LexBoxApi/Program.cs @@ -169,9 +169,7 @@ app.UseAuthorization(); app.MapSecurityTxt(); app.MapNitroApp("/api/graphql/ui").WithOptions(new (){ServeMode = GraphQLToolServeMode.Embedded}).AllowAnonymous(); -if (app.Environment.IsDevelopment()) - //required for vite to generate types - app.MapGraphQLSchema("/api/graphql/schema.graphql").AllowAnonymous(); +app.MapGraphQLSchema("/api/graphql/schema.graphql").AllowAnonymous(); app.MapGraphQLHttp("/api/graphql"); app.MapQuartzUI("/api/quartz").RequireAuthorization(new AdminRequiredAttribute());