fullstack-tutorial icon indicating copy to clipboard operation
fullstack-tutorial copied to clipboard

querying `launches` returns errors on "final" repo.

Open corpetty opened this issue 6 years ago • 6 comments

It seems the tutorial is out of date, as even the final returns errors, so I know it isn't with my implementation after going through the tutorial.

The playground returns the following after running the GetLaunches query from the tutorial:

{
  "error": {
    "errors": [
      {
        "message": "Cannot query field \"id\" on type \"LaunchConnection\".",
        "locations": [
          {
            "line": 3,
            "column": 5
          }
        ],
        "extensions": {
          "code": "GRAPHQL_VALIDATION_FAILED",
          "exception": {
            "stacktrace": [
              "GraphQLError: Cannot query field \"id\" on type \"LaunchConnection\".",
              "    at Object.Field (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/validation/rules/FieldsOnCorrectType.js:64:31)",
              "    at Object.enter (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/language/visitor.js:333:29)",
              "    at Object.enter (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/language/visitor.js:384:25)",
              "    at visit (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/language/visitor.js:251:26)",
              "    at Object.validate (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/validation/validate.js:63:22)",
              "    at validate (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/apollo-server-core/dist/requestPipeline.js:172:32)",
              "    at Object.<anonymous> (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/apollo-server-core/dist/requestPipeline.js:113:38)",
              "    at Generator.next (<anonymous>)",
              "    at fulfilled (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/apollo-server-core/dist/requestPipeline.js:4:58)",
              "    at process._tickCallback (internal/process/next_tick.js:68:7)"
            ]
          }
        }
      },
      {
        "message": "Cannot query field \"mission\" on type \"LaunchConnection\".",
        "locations": [
          {
            "line": 4,
            "column": 5
          }
        ],
        "extensions": {
          "code": "GRAPHQL_VALIDATION_FAILED",
          "exception": {
            "stacktrace": [
              "GraphQLError: Cannot query field \"mission\" on type \"LaunchConnection\".",
              "    at Object.Field (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/validation/rules/FieldsOnCorrectType.js:64:31)",
              "    at Object.enter (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/language/visitor.js:333:29)",
              "    at Object.enter (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/language/visitor.js:384:25)",
              "    at visit (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/language/visitor.js:251:26)",
              "    at Object.validate (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/graphql/validation/validate.js:63:22)",
              "    at validate (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/apollo-server-core/dist/requestPipeline.js:172:32)",
              "    at Object.<anonymous> (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/apollo-server-core/dist/requestPipeline.js:113:38)",
              "    at Generator.next (<anonymous>)",
              "    at fulfilled (/home/petty/Github/apollo-graphql/fullstack-tutorial/final/server/node_modules/apollo-server-core/dist/requestPipeline.js:4:58)",
              "    at process._tickCallback (internal/process/next_tick.js:68:7)"
            ]
          }
        }
      }
    ]
  }
}

corpetty avatar Apr 11 '19 12:04 corpetty

versions:

  • npm: 6.4.1
  • node: 10.15.3

corpetty avatar Apr 11 '19 12:04 corpetty

You must do the query as follows:

query GetLaunches {
  launches {
    launches {
      id
      mission {
        name
      }
    }
  }
}

logusgraphics avatar Jul 09 '19 01:07 logusgraphics

The error mentioned by @corpetty is happening to me if I try the steps in run-queries-in-the-playground before adding Paginated queries to the resolver.

aphex- avatar Aug 10 '19 11:08 aphex-

Same here, this tutorial doesn't work...

marcio-codes avatar Aug 10 '19 21:08 marcio-codes

same here it doesn't wok

deolaolalere avatar Sep 09 '19 02:09 deolaolalere

the query (with pagination) doesn't work only in the playground. But it works perfectly in others clients (Apollo Client / React, apollo studio ...)

hafidaEL avatar Nov 17 '20 12:11 hafidaEL