google / rejoiner

Generates a unified GraphQL schema from gRPC microservices and other Protobuf sources
https://google.github.io/rejoiner/
Apache License 2.0
3.67k stars 144 forks source link

Example is not working #86

Open haiminh87 opened 5 years ago

haiminh87 commented 5 years ago

I cloned master and follow the instruction here https://rejoiner.io/docs/examples.html But got this error

{
  "errors": [
    {
      "message": "Exception while fetching data (/sayHello) : java.lang.IllegalArgumentException: argument type mismatch",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "sayHello"
      ]
    }
  ],
  "data": {
    "sayHello": null
  }
}
siderakis commented 5 years ago

I’ve seen something similar before, can you rerun the installDist command then relaunch the two processes.

siderakis commented 5 years ago

I just tested from a clean install and it seems to be working.

timburks commented 4 years ago

I'm also experiencing this with fresh builds on two platforms (MacOS and Ubuntu). My Java versions are 1.8.0_151 (MacOS) and 1.8.0_222 (Ubuntu).

jhaals commented 4 years ago

I'm currently running into the same issue when ./gradlew openIdea, starting both servers for helloworld and executing the graphql query

WillemHoman commented 4 years ago

yup, me too on jdk1.8.0_152, 9+181 osx all examples

DianaSuvorova commented 4 years ago

Same here. java version "1.8.0_152" macOS 10.14.6 with gradle example

DianaSuvorova commented 4 years ago

Some more details on the issue. The error happens on this line

return method.invoke(module, methodParameterValues);

if I try to call the sayHello method directly

((HelloWorldSchemaModule) module).sayHello(methodParameterValues[0], methodParameterValues[1])

I get

Type mismatch Can't assign com.google.inject.spi.ProviderLookup$1 to io.grpc.examples.helloworld.GreeterGrpc$GreeterBlockingStub

Any help would be appreciated.

siderakis commented 4 years ago

I switched the version of rejoiner in the gradle examples to 0.4.0-SNAPSHOT which seems to have fixed the issue.

siderakis commented 4 years ago

In general these examples need to be updated. I'd like to move them to use maven like the rest of the code.

DianaSuvorova commented 4 years ago

@siderakis thanks a bunch. This fixed the issue. The example is working for me now.