Поддержка The Movie Database

I'm playing with the GraphQL server and I've got this error in the NodeJS module:

{
  url: {
    url: 'http://api.themoviedb.org/3/movie/315723/casts?api_key=<<api_key>>'
  },
  error: Error: read ECONNRESET
      at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
    errno: -104,
    code: 'ECONNRESET',
    syscall: 'read'
  },
  res: null,
  response: undefined,
  body: undefined,
  callback: [Function (anonymous)]
}

So the API reset the connection. Maybe I used too many requests. This is my GraphQL query:

{
  movies {
    title
    cast {
      id
      name
      character
      movies {
        title
        cast {
          character
        }
      }
    }
  }
}

The first request is to search for the movies "matrix" then for each movie it request the cast and for each cast, it requests movies and again it requests the cast of each movie.

I'm just testing the API, both TMDB and my GraphQL server let me know if this is too many requests or is this some kind of error. I'm still learning GraphQL.

3 ответов (на странице 1 из 1)

Jump to last post

Hi, I don't think TMDB offers a GraphQL API. Are you using some sort of wrapper or translation layer? If so, which one?

I'm using REST API i and I have my own GraphQL server. Because I'm learning GraphQL. The whole point is to create my own GraphQL server.

@jcubic
I don't know if this is the cause.
You are using an API Request that I didn't know about.
But it works. Maybe it's one of the undocumented ones.
The first is yours, the second is documented.

1 - http://api.themoviedb.org/3/movie/315723/casts?api_key=<<api_key>>
2 - https://api.themoviedb.org/3/movie/315723/credits?api_key=THE_KEY 

You use "casts", and the documented one is with "credits".

Не можете найти фильм или сериал? Войдите на сайт, чтобы добавить его.

Глобальные

s фокусироваться на панели поиска
p открыть меню профиля
esc закрыть открытое окно
? открыть окно сочетаний клавиш

На страницах медиа

b назад (или выше, если применимо)
e перейти на страницу правки

На страницах сезонов

(стрелка вправо) перейти к следующему сезону
(стрелка влево) перейти к предыдущему сезону

На страницах эпизодов

(стрелка вправо) перейти к следующему эпизоду
(стрелка влево) перейти к предыдущему эпизоду

На всех страницах изображений

a открыть окно добавления изображения

На всех страницах правки

t открыть переключатель переводов
ctrl+ s отправить форму

На страницах обсуждения

n создать новое обсуждение
w сменить статус отслеживания
p публичное/приватное
c закрыть/открыть
a открыть страницу действий
r ответить в обсуждении
l перейти к последнему ответу
ctrl+ enter отправить своё сообщение
(стрелка вправо) следующая страница
(стрелка влево) предыдущая страница

Параметры

Хотите поставить оценку или добавить в список?

Войти