apollographql / federation

🌐  Build and scale a single data graph across multiple services with Apollo's federation gateway.
https://apollographql.com/docs/federation/
Other
669 stars 254 forks source link

mutations are not working when put through Geteway #2208

Closed squarewave24 closed 2 years ago

squarewave24 commented 4 years ago

I am using Apollo Geteway with my react app connecting to python api's using graphene.

all queries work fine, but when trying to use a mutation i get this generic error

the query works when i paste it into the endpoint graphql playground, but not from apollo geteway playground :(

query:

mutation review{
  review(my_date:"2020-06-02")
  {
    success
  }
}

error:


"error": {
    "errors": [
      {
        "message": "Schema is not configured for mutations.",
        "locations": [
          {
            "line": 1,
            "column": 1
          }
        ],
        "extensions": {
          "code": "INTERNAL_SERVER_ERROR",
          "exception": {
            "stacktrace": [
              "GraphQLError: Schema is not configured for mutations.",
              "    at Object.getOperationRootType (/Users/rafal.buch/dev/ground-control/node_modules/graphql/utilities/getOperationRootType.js:28:13)",
              "    at Object.buildQueryPlan (/Users/rafal.buch/dev/ground-control/node_modules/@apollo/gateway/src/buildQueryPlan.ts:80:20)",
              "    at Object.ApolloGateway.executor (/Users/rafal.buch/dev/ground-control/node_modules/@apollo/gateway/src/index.ts:659:19)",
              "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
            ]

versions:

"@apollo/gateway": "^0.16.2",
"apollo-server": "^2.14.1",
"apollo-server-express": "^2.14.1",

graphene==2.1.8
graphene-federation==0.1.0

i also tried simplified queries that just return True on server. again work in regular endpoint playground, but not in apollo server geteway

mutation {
  testMutation {
    success
  }
}

mutation testMutation {
  testMutation {
    success
  }
}
jhampton commented 4 years ago

@squarewave24 Can you share a minimal reproduction with a schema please? I have only found examples of this error when there are mistyped schema entries or queries.

glasser commented 2 years ago

Going to close this because it doesn't have a reproduction (and also transfer it to the repository where Gateway now lives).