• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript graphql-relay-tools.connectionArgs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript graphql-request.request函数代码示例发布时间:2022-05-25
下一篇:
TypeScript graphql-relay.nodeDefinitions函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap