Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
Esquema GraphQL con objetos anidados

Cómo escribir un esquema para este tipo de respuesta.

 { "adult": false, "backdrop_path": "/dnaitaoCh8MftfYEVnprcuYExZp.jpg", "belongs_to_collection": { "id": 256322, "name": "The Purge Collection", "poster_path": "/nP3c8mTSxlis4vfg0UjlkK8LRG9.jpg", "backdrop_path": "/quFWGOA4I5KCTsyDbvLh6PHNZwv.jpg" }, "budget": 13000000, "genres": [ { "id": 28, "name": "Action" }, { "id": 27, "name": "Horror" }, { "id": 878, "name": "Science Fiction" }, { "id": 53, "name": "Thriller" } ] }
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

const typeDefs = ` type BelongsToCollectionType { id: ID! name: String poster_path: String backdrop_path: String } type GenreType { id: ID! name: String } type SomeType { adult: Boolean backdrop_path: String belongs_to_collection: BelongsToCollectionType budget: Int genres: [GenreType]! } `;
over 4 years ago · Santiago Trujillo Denunciar

0

Poco después de hacer esta pregunta lo descubrí. Aquí está el esquema:

 const MovieType = new GraphQLObjectType({ name: 'Movie', fields: () => ({ id: { type: GraphQLString }, adult: { type: GraphQLBoolean }, backdrop_path: { type: GraphQLString }, belongs_to_collection: { type: BelongsToCollection }, budget: { type: GraphQLInt }, overview: { type: GraphQLString }, popularity: { type: GraphQLInt }, poster_path: { type: GraphQLString }, production_companies: { type: new GraphQLList(CompaniesType) }, genres: { type: new GraphQLList(GenreType) }, release_date: { type: GraphQLString }, tagline: { type: GraphQLString }, title: { type: GraphQLString }, vote_average: { type: GraphQLInt }, vote_count: { type: GraphQLInt } }) }); const CompaniesType = new GraphQLObjectType({ name: 'ProductionCompanies', fields: { id: { type: GraphQLInt }, name: { type: GraphQLString }, logo_path: { type: GraphQLString }, original_country: { type: GraphQLString } } }); const GenreType = new GraphQLObjectType({ name: 'Genre', fields: () => ({ id: { type: GraphQLInt }, name: { type: GraphQLString } }) }) const BelongsToCollection = new GraphQLObjectType({ name: 'BelongsToCollection', fields: () => ({ id: { type: GraphQLInt }, name: { type: GraphQLString }, poster_path: { type: GraphQLString }, backdrop_path: { type: GraphQLString } }) });
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda