graphql-client
graphql-client copied to clipboard
MissingMethodException on local execution
Package info
Package: GraphQL.Client.LocalExecution Version: 3.2.3
Description
MissingMethodException
thrown when call SendQueryAsync
.
Code to reproduce
var sourceSchema = Schema.For(@"
type QT {
idField: ID
intField: Int
floatField: Float
stringField: String
}");
var client = GraphQLLocalExecutionClient.New(sourceSchema, new NewtonsoftJsonSerializer());
var request = new GraphQLRequest { Query = "query { __schema { types { name } } }" };
var res = await client.SendQueryAsync<JToken>(request);
Expected
Query successfully executed.
Actual
MissingMethodException: Method not found: "GraphQL.Inputs GraphQL.StringExtensions.ToInputs(Newtonsoft.Json.Linq.JObject)".
Additiona info
Problem appeares when I add in my project reference to package GraphQl.4.3.0
(latest for now). Package GraphQL.Client.LocalExecution.3.2.3
depends on GraphQl.2.4.0
, where required method exists, but when package manager resolve dependencies, it updates package dapendency to 4.3.0, where required method is missing.
4.x is backward incompatible with both 3.x and 2.4.0.
Why package GraphQL.Client.LocalExecution.3.2.3
depends on GraphQL >= 2.4.0
then? It shoud be stricted by version 2.4.0
in nuspec file ([2.4,3)
instead of 2.4.0
).
In general, yes, but people don't always use the upper version limit of the used packages. Ping @rose-a
I agree this should be updated. Unfortunately I'm currently quite short on time. A PR is of course very welcome.