gcarterIT
gcarterIT

Reputation: 135

IMDb API GraphQL - query multiple names

I am using the IMDb API, and attempting to extract info using a GraphQL query. I wish to extract info for multiple actors using this query:

{
  names(ids: ["nm0000158", "nm0000226", "nm0000138"]) {
    id
    Name
    birthDate
  }
}

When I run this query in the IMDb GraphQL playground I get this message:

"errors": [
    {
      "message": "Cannot query field \"Name\" on type \"Name\".",
      "locations": [
        {
          "line": 4,
          "column": 5
        }
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    },
    {
      "message": "Cannot query field \"birthDate\" on type \"Name\".",
      "locations": [
        {
          "line": 5,
          "column": 5
        }
      ],
      "extensions": {
        "code": "GRAPHQL_VALIDATION_FAILED"
      }
    }
  ],
  "data": null
} 

Please share any suggestions or ideas. Thanks.

Upvotes: 0

Views: 107

Answers (1)

keria
keria

Reputation: 181

Fields you can query must match the fields service has defined, check out valid fields here

Upvotes: 0

Related Questions