mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-21 08:21:53 +02:00
Use GraphQL 8.2.1 (#1211)
This commit is contained in:
@@ -113,16 +113,16 @@ public class GraphQLMatcher : IStringMatcher
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var executionResult = new DocumentExecuter().ExecuteAsync(_ =>
|
var executionResult = new DocumentExecuter().ExecuteAsync(eo =>
|
||||||
{
|
{
|
||||||
_.ThrowOnUnhandledException = true;
|
eo.ThrowOnUnhandledException = true;
|
||||||
|
|
||||||
_.Schema = _schema;
|
eo.Schema = _schema;
|
||||||
_.Query = graphQLRequest.Query;
|
eo.Query = graphQLRequest.Query;
|
||||||
|
|
||||||
if (graphQLRequest.Variables != null)
|
if (graphQLRequest.Variables != null)
|
||||||
{
|
{
|
||||||
_.Variables = new Inputs(graphQLRequest.Variables);
|
eo.Variables = new Inputs(graphQLRequest.Variables);
|
||||||
}
|
}
|
||||||
}).GetAwaiter().GetResult();
|
}).GetAwaiter().GetResult();
|
||||||
|
|
||||||
|
|||||||
@@ -144,8 +144,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard1.3' and '$(TargetFramework)' != 'net451' and '$(TargetFramework)' != 'net452' and '$(TargetFramework)' != 'net46' and '$(TargetFramework)' != 'net461'">
|
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard1.3' and '$(TargetFramework)' != 'net451' and '$(TargetFramework)' != 'net452' and '$(TargetFramework)' != 'net46' and '$(TargetFramework)' != 'net461'">
|
||||||
<PackageReference Include="GraphQL" Version="7.5.0" />
|
<PackageReference Include="GraphQL.NewtonsoftJson" Version="8.2.1" />
|
||||||
<PackageReference Include="GraphQL.NewtonsoftJson" Version="7.5.0" />
|
|
||||||
<PackageReference Include="MimeKitLite" Version="4.1.0.1" />
|
<PackageReference Include="MimeKitLite" Version="4.1.0.1" />
|
||||||
<PackageReference Include="ProtoBufJsonConverter" Version="0.5.0" />
|
<PackageReference Include="ProtoBufJsonConverter" Version="0.5.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -107,22 +107,32 @@ public class GraphQLMatcherTests
|
|||||||
public void GraphQLMatcher_For_ValidSchema_And_CorrectGraphQL_UsingCustomType_Mutation_IsMatch()
|
public void GraphQLMatcher_For_ValidSchema_And_CorrectGraphQL_UsingCustomType_Mutation_IsMatch()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
const string testSchema = @"
|
// Query is provided here: https://stackoverflow.com/questions/59608833/apollo-graphql-error-query-root-type-must-be-provided
|
||||||
scalar DateTime
|
const string testSchema =
|
||||||
scalar MyCustomScalar
|
"""
|
||||||
|
scalar DateTime
|
||||||
|
scalar MyCustomScalar
|
||||||
|
|
||||||
|
type Query {
|
||||||
|
_empty: String
|
||||||
|
}
|
||||||
|
|
||||||
|
type Message {
|
||||||
|
id: ID!
|
||||||
|
}
|
||||||
|
|
||||||
|
type Mutation {
|
||||||
|
createMessage(x: MyCustomScalar, dt: DateTime): Message
|
||||||
|
}
|
||||||
|
""";
|
||||||
|
|
||||||
type Message {
|
const string input =
|
||||||
id: ID!
|
"""
|
||||||
}
|
{
|
||||||
|
"query": "mutation CreateMessage($x: MyCustomScalar!, $dt: DateTime!) { createMessage(x: $x, dt: $dt) { id } }",
|
||||||
type Mutation {
|
"variables": { "x": 100, "dt": "2007-12-03T10:15:30Z" }
|
||||||
createMessage(x: MyCustomScalar, dt: DateTime): Message
|
}
|
||||||
}";
|
""";
|
||||||
|
|
||||||
var input = @"{
|
|
||||||
""query"": ""mutation CreateMessage($x: MyCustomScalar!, $dt: DateTime!) { createMessage(x: $x, dt: $dt) { id } }"",
|
|
||||||
""variables"": { ""x"": 100, ""dt"": ""2007-12-03T10:15:30Z"" }
|
|
||||||
}";
|
|
||||||
|
|
||||||
var customScalars = new Dictionary<string, Type> { { "MyCustomScalar", typeof(int) } };
|
var customScalars = new Dictionary<string, Type> { { "MyCustomScalar", typeof(int) } };
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,6 @@
|
|||||||
<ItemGroup Condition="'$(TargetFramework)' != 'net452'">
|
<ItemGroup Condition="'$(TargetFramework)' != 'net452'">
|
||||||
<PackageReference Include="System.Net.Http.Json" Version="3.2.1" />
|
<PackageReference Include="System.Net.Http.Json" Version="3.2.1" />
|
||||||
<PackageReference Include="JsonConverter.System.Text.Json" Version="0.7.0" />
|
<PackageReference Include="JsonConverter.System.Text.Json" Version="0.7.0" />
|
||||||
|
|
||||||
<PackageReference Include="Google.Protobuf" Version="3.25.1" />
|
<PackageReference Include="Google.Protobuf" Version="3.25.1" />
|
||||||
<PackageReference Include="Grpc.Net.Client" Version="2.60.0" />
|
<PackageReference Include="Grpc.Net.Client" Version="2.60.0" />
|
||||||
<PackageReference Include="Grpc.Tools" Version="2.60.0">
|
<PackageReference Include="Grpc.Tools" Version="2.60.0">
|
||||||
|
|||||||
Reference in New Issue
Block a user