当前位置: 首页>>代码示例>>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;未经允许,请勿转载。