public GraphQLHttpResponse(GraphQLResponse <T> response, HttpResponseHeaders responseHeaders, HttpStatusCode statusCode) { Data = response.Data; Errors = response.Errors; ResponseHeaders = responseHeaders; StatusCode = statusCode; }
/// <summary> /// Casts <paramref name="response"/> to <see cref="GraphQLHttpResponse{T}"/>. Throws if the cast fails. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="response"></param> /// <exception cref="InvalidCastException"><paramref name="response"/> is not a <see cref="GraphQLHttpResponse{T}"/></exception> /// <returns></returns> public static GraphQLHttpResponse <T> AsGraphQLHttpResponse <T>(this GraphQLResponse <T> response) => (GraphQLHttpResponse <T>)response;
public static GraphQLHttpResponse <T> ToGraphQLHttpResponse <T>(this GraphQLResponse <T> response, HttpResponseHeaders responseHeaders, HttpStatusCode statusCode) => new GraphQLHttpResponse <T>(response, responseHeaders, statusCode);