From 7eb4e08b437fda3235cccc3b9ed9e300b1622c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Dang=C3=A5rden?= Date: Fri, 28 Mar 2025 07:37:32 +0100 Subject: [PATCH] Fixed Safemode Schema query --- src/Linq2GraphQL.Client/GraphClient.cs | 2 +- src/Linq2GraphQL.Client/Schema/Helpers.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Linq2GraphQL.Client/GraphClient.cs b/src/Linq2GraphQL.Client/GraphClient.cs index d5bea8f4..1dfff83b 100644 --- a/src/Linq2GraphQL.Client/GraphClient.cs +++ b/src/Linq2GraphQL.Client/GraphClient.cs @@ -73,7 +73,7 @@ public async Task GetSchemaForSafeModeAsync() { var executor = new QueryExecutor(this); - var graphRequest = new GraphQLRequest { Query = Helpers.SchemaQuery }; + var graphRequest = new GraphQLRequest { Query = Helpers.SchemaQueryIncludeDeprecated }; return await executor.ExecuteRequestAsync("__schema", graphRequest); }); } diff --git a/src/Linq2GraphQL.Client/Schema/Helpers.cs b/src/Linq2GraphQL.Client/Schema/Helpers.cs index bc5317f1..e0394642 100644 --- a/src/Linq2GraphQL.Client/Schema/Helpers.cs +++ b/src/Linq2GraphQL.Client/Schema/Helpers.cs @@ -12,4 +12,15 @@ internal static class Helpers } } }"; + + internal const string SchemaQueryIncludeDeprecated = @"{ + __schema { + types { + name + fields(includeDeprecated: true) { + name + } + } + } + }"; } \ No newline at end of file