Skip to content

Commit 23aa318

Browse files
committed
Use GraphQL 8.2.1
1 parent f4103b4 commit 23aa318

File tree

4 files changed

+32
-24
lines changed

4 files changed

+32
-24
lines changed

src/WireMock.Net/Matchers/GraphQLMatcher.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ public MatchResult IsMatch(string? input)
113113
{
114114
try
115115
{
116-
var executionResult = new DocumentExecuter().ExecuteAsync(_ =>
116+
var executionResult = new DocumentExecuter().ExecuteAsync(eo =>
117117
{
118-
_.ThrowOnUnhandledException = true;
118+
eo.ThrowOnUnhandledException = true;
119119

120-
_.Schema = _schema;
121-
_.Query = graphQLRequest.Query;
120+
eo.Schema = _schema;
121+
eo.Query = graphQLRequest.Query;
122122

123123
if (graphQLRequest.Variables != null)
124124
{
125-
_.Variables = new Inputs(graphQLRequest.Variables);
125+
eo.Variables = new Inputs(graphQLRequest.Variables);
126126
}
127127
}).GetAwaiter().GetResult();
128128

src/WireMock.Net/WireMock.Net.csproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@
144144
</ItemGroup>
145145

146146
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard1.3' and '$(TargetFramework)' != 'net451' and '$(TargetFramework)' != 'net452' and '$(TargetFramework)' != 'net46' and '$(TargetFramework)' != 'net461'">
147-
<PackageReference Include="GraphQL" Version="7.5.0" />
148-
<PackageReference Include="GraphQL.NewtonsoftJson" Version="7.5.0" />
147+
<PackageReference Include="GraphQL.NewtonsoftJson" Version="8.2.1" />
149148
<PackageReference Include="MimeKitLite" Version="4.1.0.1" />
150149
<PackageReference Include="ProtoBufJsonConverter" Version="0.5.0" />
151150
</ItemGroup>

test/WireMock.Net.Tests/Matchers/GraphQLMatcherTests.cs

+26-16
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,32 @@ public void GraphQLMatcher_For_ValidSchema_And_CorrectGraphQL_Mutation_IsMatch()
107107
public void GraphQLMatcher_For_ValidSchema_And_CorrectGraphQL_UsingCustomType_Mutation_IsMatch()
108108
{
109109
// Arrange
110-
const string testSchema = @"
111-
scalar DateTime
112-
scalar MyCustomScalar
113-
114-
type Message {
115-
id: ID!
116-
}
117-
118-
type Mutation {
119-
createMessage(x: MyCustomScalar, dt: DateTime): Message
120-
}";
121-
122-
var input = @"{
123-
""query"": ""mutation CreateMessage($x: MyCustomScalar!, $dt: DateTime!) { createMessage(x: $x, dt: $dt) { id } }"",
124-
""variables"": { ""x"": 100, ""dt"": ""2007-12-03T10:15:30Z"" }
125-
}";
110+
// Query is provided here: https://stackoverflow.com/questions/59608833/apollo-graphql-error-query-root-type-must-be-provided
111+
const string testSchema =
112+
"""
113+
scalar DateTime
114+
scalar MyCustomScalar
115+
116+
type Query {
117+
_empty: String
118+
}
119+
120+
type Message {
121+
id: ID!
122+
}
123+
124+
type Mutation {
125+
createMessage(x: MyCustomScalar, dt: DateTime): Message
126+
}
127+
""";
128+
129+
const string input =
130+
"""
131+
{
132+
"query": "mutation CreateMessage($x: MyCustomScalar!, $dt: DateTime!) { createMessage(x: $x, dt: $dt) { id } }",
133+
"variables": { "x": 100, "dt": "2007-12-03T10:15:30Z" }
134+
}
135+
""";
126136

127137
var customScalars = new Dictionary<string, Type> { { "MyCustomScalar", typeof(int) } };
128138

test/WireMock.Net.Tests/WireMock.Net.Tests.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
<ItemGroup Condition="'$(TargetFramework)' != 'net452'">
106106
<PackageReference Include="System.Net.Http.Json" Version="3.2.1" />
107107
<PackageReference Include="JsonConverter.System.Text.Json" Version="0.7.0" />
108-
109108
<PackageReference Include="Google.Protobuf" Version="3.25.1" />
110109
<PackageReference Include="Grpc.Net.Client" Version="2.60.0" />
111110
<PackageReference Include="Grpc.Tools" Version="2.60.0">

0 commit comments

Comments
 (0)