graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

MissingMethodException on local execution

Open ds1709 opened this issue 3 years ago • 4 comments

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.

ds1709 avatar Apr 19 '21 14:04 ds1709

4.x is backward incompatible with both 3.x and 2.4.0.

sungam3r avatar Apr 19 '21 17:04 sungam3r

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).

ds1709 avatar Apr 19 '21 19:04 ds1709

In general, yes, but people don't always use the upper version limit of the used packages. Ping @rose-a

sungam3r avatar Apr 20 '21 06:04 sungam3r

I agree this should be updated. Unfortunately I'm currently quite short on time. A PR is of course very welcome.

rose-a avatar Apr 21 '21 19:04 rose-a