Hello community. Seeking some advice. I am current...
# orm-help
a
Hello community. Seeking some advice. I am currently using a graphql server with prisma as a gateway. This
gateway
is hitting another `graphql-server`(microservice). In turn that
graphql-server
does another mutation to the database. I am hitting from my gateway:
createReport(input: ReportInput!): JSON!
Copy code
input ReportInput {
  queryLimit: Int!
  businessEntityId: Int!
}
This works fine: The graphql Server I’m hitting triggers this mutation:
createReport(input: JasperInput!): Report
My issue is when using playground: I get this back:
Copy code
{
  "data": null,
  "errors": [
    {
      "message": "Cannot return null for non-nullable field Mutation.createReport.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "createReport"
      ]
    }
  ]
}
l
What is your
JSON
type definition?
a
scalar JSON
on my gateway
So now I am wrapping it as a service and try to make the call from my resolver, I think this was part of the issue
still no luck :S if I am able to hit that server from my gateway I can probably take care of the rest
l
The problem is whatever your
createReport
resolver returns is not matching the
JSON
type.
a
I fixed it thanks @lawjolla, that was part of it, also the way I was structuring the service and correctly passing it to the resolver
👍 1