File tree 2 files changed +0
-33
lines changed
tests/GraphQL.Integration.Tests/QueryAndMutationTests
2 files changed +0
-33
lines changed Original file line number Diff line number Diff line change 1
1
using System . Net . Http . Headers ;
2
- using System . Runtime . Serialization ;
3
2
using System . Text ;
4
3
using GraphQL . Client . Abstractions ;
5
4
@@ -21,13 +20,6 @@ public GraphQLHttpRequest(GraphQLRequest other)
21
20
{
22
21
}
23
22
24
- /// <summary>
25
- /// Allows to preprocess a <see cref="HttpRequestMessage"/> before it is sent, i.e. add custom headers
26
- /// </summary>
27
- [ IgnoreDataMember ]
28
- [ Obsolete ( "Inherit from GraphQLHttpRequest and override ToHttpRequestMessage() to customize the HttpRequestMessage. Will be removed in v4.0.0." ) ]
29
- public Action < HttpRequestMessage > PreprocessHttpRequestMessage { get ; set ; } = message => { } ;
30
-
31
23
/// <summary>
32
24
/// Creates a <see cref="HttpRequestMessage"/> from this <see cref="GraphQLHttpRequest"/>.
33
25
/// Used by <see cref="GraphQLHttpClient"/> to convert GraphQL requests when sending them as regular HTTP requests.
@@ -48,9 +40,6 @@ public virtual HttpRequestMessage ToHttpRequestMessage(GraphQLHttpClientOptions
48
40
if ( options . DefaultUserAgentRequestHeader != null )
49
41
message . Headers . UserAgent . Add ( options . DefaultUserAgentRequestHeader ) ;
50
42
51
- #pragma warning disable CS0618 // Type or member is obsolete
52
- PreprocessHttpRequestMessage ( message ) ;
53
- #pragma warning restore CS0618 // Type or member is obsolete
54
43
return message ;
55
44
}
56
45
}
Original file line number Diff line number Diff line change @@ -163,28 +163,6 @@ query Human($id: String!){
163
163
Assert . Equal ( "Han Solo" , queryResponse . Data . Human . Name ) ;
164
164
}
165
165
166
- [ Fact ]
167
- public async void PreprocessHttpRequestMessageIsCalled ( )
168
- {
169
- var callbackTester = new CallbackMonitor < HttpRequestMessage > ( ) ;
170
- var graphQLRequest = new GraphQLHttpRequest ( $ "{{ human(id: \" 1\" ) {{ name }} }}")
171
- {
172
- #pragma warning disable CS0618 // Type or member is obsolete
173
- PreprocessHttpRequestMessage = callbackTester . Invoke
174
- #pragma warning restore CS0618 // Type or member is obsolete
175
- } ;
176
-
177
- var expectedHeaders = new HttpRequestMessage ( ) . Headers ;
178
- expectedHeaders . UserAgent . Add ( new ProductInfoHeaderValue ( "GraphQL.Client" , typeof ( GraphQLHttpClient ) . Assembly . GetName ( ) . Version . ToString ( ) ) ) ;
179
- expectedHeaders . Accept . Add ( new MediaTypeWithQualityHeaderValue ( "application/graphql-response+json" ) ) ;
180
- expectedHeaders . Accept . Add ( new MediaTypeWithQualityHeaderValue ( "application/json" ) ) ;
181
- expectedHeaders . AcceptCharset . Add ( new StringWithQualityHeaderValue ( "utf-8" ) ) ;
182
- var response = await StarWarsClient . SendQueryAsync ( graphQLRequest , ( ) => new { Human = new { Name = string . Empty } } ) ;
183
- callbackTester . Should ( ) . HaveBeenInvokedWithPayload ( ) . Which . Headers . Should ( ) . BeEquivalentTo ( expectedHeaders ) ;
184
- Assert . Null ( response . Errors ) ;
185
- Assert . Equal ( "Luke" , response . Data . Human . Name ) ;
186
- }
187
-
188
166
[ Fact ]
189
167
public async Task PostRequestCanBeCancelled ( )
190
168
{
You can’t perform that action at this time.
0 commit comments