Skip to content

Commit cf7c7c0

Browse files
sungam3rrose-a
authored andcommitted
progress
1 parent 058d2e6 commit cf7c7c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/GraphQL.Client/GraphQLHttpClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ private async Task<GraphQLHttpResponse<TResponse>> SendAPQHttpRequestAsync<TResp
152152

153153
var response = await SendHttpRequestAsync<TResponse>(request, cancellationToken);
154154

155-
if (useAPQ && response.Errors?.Length > 0)
155+
if (useAPQ)
156156
{
157-
if (response.Errors.Any(error => string.Equals(error.Message, "PersistedQueryNotFound", StringComparison.CurrentCultureIgnoreCase)))
157+
if (response.Errors?.Any(error => string.Equals(error.Message, "PersistedQueryNotFound", StringComparison.CurrentCultureIgnoreCase)) == true)
158158
{
159159
// GraphQL server supports APQ!
160160

src/GraphQL.Client/GraphQLHttpClientOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ public static bool DefaultIsValidResponseToDeserialize(HttpResponseMessage r)
114114
public Func<IGraphQLHttpResponse, bool> DisableAPQ { get; set; } = response =>
115115
{
116116
return ((int)response.StatusCode >= 400 && (int)response.StatusCode < 600) ||
117-
response.Errors.Any(error => string.Equals(error.Message, "PersistedQueryNotSupported"));
117+
response.Errors?.Any(error => string.Equals(error.Message, "PersistedQueryNotSupported", StringComparison.CurrentCultureIgnoreCase)) == true;
118118
};
119119
}

0 commit comments

Comments
 (0)