當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript graphql-relay-tools.connectionArgs函數代碼示例

本文整理匯總了TypeScript中graphql-relay-tools.connectionArgs函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript connectionArgs函數的具體用法?TypeScript connectionArgs怎麽用?TypeScript connectionArgs使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了connectionArgs函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: film

import person from './person';
import planet from './planet';
import species from './species';
import starship from './starship';
import vehicle from './vehicle';

const swapi: string = `
# import * from "film"
# import * from "person"
# import * from "planet"
# import * from "species"
# import * from "starship"
# import * from "vehicle"

type Query {
  allFilms${connectionArgs()}: FilmsConnection
  film(id: ID, filmID: ID): Film

  allPeople${connectionArgs()}: PeopleConnection
  person(id: ID, personID: ID): Person

  allPlanets${connectionArgs()}: PlanetsConnection
  planet(id: ID, planetID: ID): Planet

  allSpecies${connectionArgs()}: SpeciesConnection
  species(id: ID, speciesID: ID): Species

  allStarships${connectionArgs()}: StarshipsConnection
  starship(id: ID, starshipID: ID): Starship

  allVehicles${connectionArgs()}: VehiclesConnection
開發者ID:Alexandr-Baluhin,項目名稱:nodejs-graphql-template,代碼行數:31,代碼來源:index.ts

示例2: name

  """The episode number of this film."""
  episodeID: Int

  """The opening paragraphs at the beginning of this film."""
  openingCrawl: String

  """The name of the director of this film."""
  director: String

  """The name(s) of the producer(s) of this film."""
  producers: [String]

  """The ISO 8601 date format of film release at original creator country."""
  releaseDate: String
  speciesConnection${connectionArgs()}: FilmSpeciesConnection
  starshipConnection${connectionArgs()}: FilmStarshipsConnection
  vehicleConnection${connectionArgs()}: FilmVehiclesConnection
  characterConnection${connectionArgs()}: FilmCharactersConnection
  planetConnection${connectionArgs()}: FilmPlanetsConnection

  """The ISO 8601 date format of the time that this resource was created."""
  created: String

  """The ISO 8601 date format of the time that this resource was edited."""
  edited: String

  """The ID of an object"""
  id: ID!
}
開發者ID:Alexandr-Baluhin,項目名稱:nodejs-graphql-template,代碼行數:29,代碼來源:film.ts

示例3:

  """The number of non-essential people this vehicle can transport."""
  passengers: String

  """The maximum speed of this vehicle in atmosphere."""
  maxAtmospheringSpeed: Int

  """The maximum number of kilograms that this vehicle can transport."""
  cargoCapacity: Float

  """
  The maximum length of time that this vehicle can provide consumables for its
  entire crew without having to resupply.
  """
  consumables: String
  pilotConnection${connectionArgs()}: VehiclePilotsConnection
  filmConnection${connectionArgs()}: VehicleFilmsConnection

  """The ISO 8601 date format of the time that this resource was created."""
  created: String

  """The ISO 8601 date format of the time that this resource was edited."""
  edited: String

  """The ID of an object"""
  id: ID!
}

${connectTypes('VehiclePilots', 'pilots', 'Person')}
${connectTypes('VehicleFilms', 'films', 'Film')}
`;
開發者ID:Alexandr-Baluhin,項目名稱:nodejs-graphql-template,代碼行數:30,代碼來源:vehicle.ts

示例4:

  person does not have hair.
  """
  hairColor: String

  """The height of the person in centimeters."""
  height: Int

  """The mass of the person in kilograms."""
  mass: Float

  """The skin color of this person."""
  skinColor: String

  """A planet that this person was born on or inhabits."""
  homeworld: Planet
  filmConnection${connectionArgs()}: PersonFilmsConnection

  """The species that this person belongs to, or null if unknown."""
  species: Species
  starshipConnection${connectionArgs()}: PersonStarshipsConnection
  vehicleConnection${connectionArgs()}: PersonVehiclesConnection

  """The ISO 8601 date format of the time that this resource was created."""
  created: String

  """The ISO 8601 date format of the time that this resource was edited."""
  edited: String

  """The ID of an object"""
  id: ID!
}
開發者ID:Alexandr-Baluhin,項目名稱:nodejs-graphql-template,代碼行數:31,代碼來源:person.ts

示例5: Sun

  A "Megalight" is a standard unit of distance and has never been defined before
  within the Star Wars universe. This figure is only really useful for measuring
  the difference in speed of starships. We can assume it is similar to AU, the
  distance between our Sun (Sol) and Earth.
  """
  MGLT: Int

  """The maximum number of kilograms that this starship can transport."""
  cargoCapacity: Float

  """
  The maximum length of time that this starship can provide consumables for its
  entire crew without having to resupply.
  """
  consumables: String
  pilotConnection${connectionArgs()}: StarshipPilotsConnection
  filmConnection${connectionArgs()}: StarshipFilmsConnection

  """The ISO 8601 date format of the time that this resource was created."""
  created: String

  """The ISO 8601 date format of the time that this resource was edited."""
  edited: String

  """The ID of an object"""
  id: ID!
}

${connectTypes('StarshipPilots', 'pilots', 'Person')}
${connectTypes('StarshipFilms', 'films', 'Film')}
`;
開發者ID:Alexandr-Baluhin,項目名稱:nodejs-graphql-template,代碼行數:31,代碼來源:starship.ts

示例6:

  """The average population of sentient beings inhabiting this planet."""
  population: Float

  """The climates of this planet."""
  climates: [String]

  """The terrains of this planet."""
  terrains: [String]

  """
  The percentage of the planet surface that is naturally occuring water or bodies
  of water.
  """
  surfaceWater: Float
  residentConnection${connectionArgs()}: PlanetResidentsConnection
  filmConnection${connectionArgs()}: PlanetFilmsConnection

  """The ISO 8601 date format of the time that this resource was created."""
  created: String

  """The ISO 8601 date format of the time that this resource was edited."""
  edited: String

  """The ID of an object"""
  id: ID!
}

${connectTypes('PlanetResidents', 'residents', 'Person')}
${connectTypes('PlanetFilms', 'films', 'Film')}
`;
開發者ID:Alexandr-Baluhin,項目名稱:nodejs-graphql-template,代碼行數:30,代碼來源:planet.ts

示例7:

  have hair.
  """
  hairColors: [String]

  """
  Common skin colors for this species, null if this species does not typically
  have skin.
  """
  skinColors: [String]

  """The language commonly spoken by this species."""
  language: String

  """A planet that this species originates from."""
  homeworld: Planet
  personConnection${connectionArgs()}: SpeciesPeopleConnection
  filmConnection${connectionArgs()}: SpeciesFilmsConnection

  """The ISO 8601 date format of the time that this resource was created."""
  created: String

  """The ISO 8601 date format of the time that this resource was edited."""
  edited: String

  """The ID of an object"""
  id: ID!
}

${connectTypes('SpeciesPeople', 'people', 'Person')}
${connectTypes('SpeciesFilms', 'films', 'Film')}
`;
開發者ID:Alexandr-Baluhin,項目名稱:nodejs-graphql-template,代碼行數:31,代碼來源:species.ts


注:本文中的graphql-relay-tools.connectionArgs函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。