Skip to content

Example query returns an error in GraphiQL #6

@willowell

Description

@willowell

Hello!

I just cloned the repository, but the example query in the README is returning an error in GraphiQL.

To build the server, I:

  1. cloned the repository,
  2. ran stack build inside the repository,
  3. ran npm install inside the repository,
  4. and finally ran npm start.

The query in question is:

query GetDeity {
  deity(name: "Morpheus") {
    name
    power
  }
}

which returns

{
  "errors": [
    {
      "message": "Failure on Resolving Field \"deity\": DB Error: could not find entry for ID \"Morpheus\"",
      "locations": [
        {
          "line": 2,
          "column": 27
        }
      ]
    }
  ]
}

The other endpoint is fine, that is:

query GetDeity {
  deities {
    name
    power
  }
}

returns

{
  "data": {
    "deities": [
      {
        "name": "Morpheus",
        "power": "Shape shifting"
      },
      {
        "name": "Poseidon",
        "power": "Storm"
      },
      {
        "name": "Zeus",
        "power": "thunder"
      }
    ]
  }
}

Any idea what's going on here? Did I miss something setting up the server? If there's any info I can give that may help, just let me know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions