|
| 1 | +module Graph |
| 2 | + module Types |
| 3 | + Starship = GraphQL::ObjectType.define do |
| 4 | + name "Starship" |
| 5 | + description "A single transport craft that has hyperdrive capability." |
| 6 | + |
| 7 | + field :id, types.ID, "The ID of this species." |
| 8 | + |
| 9 | + field :name, types.String, "The name of this starship. The common name, such as \"Death Star\"." |
| 10 | + field :model, types.String, "The model or official name of this starship. Such as \"T-65 X-wing\" or \"DS-1 Orbital Battle Station\"." |
| 11 | + |
| 12 | + field :starshipClass, types.String do |
| 13 | + description "The class of this starship, such as \"Starfighter\" or \"Deep Space Mobile Battlestation\"" |
| 14 | + property :starship_class |
| 15 | + end |
| 16 | + |
| 17 | + field :manufacturer, types.String, "The manufacturer of this starship." |
| 18 | + field :costInCredits, types.Float, "The cost of this starship new, in galactic credits", property: :cost_in_credits |
| 19 | + field :length, types.Float, "The length of this starship in meters." |
| 20 | + field :crew, types.String, "The number of personnel needed to run or pilot this starship." |
| 21 | + field :passengers, types.String, "The number of non-essential people this starship can transport." |
| 22 | + |
| 23 | + field :maxAtmospheringSpeed, types.Int do |
| 24 | + description "The maximum speed of this starship in atmosphere. null |
| 25 | + if this starship is incapable of atmosphering flight." |
| 26 | + property :max_atmosphering_speed |
| 27 | + end |
| 28 | + |
| 29 | + field :hyperdriveRating, types.Float, "The class of this starships hyperdrive.", property: :hyperdrive_rating |
| 30 | + |
| 31 | + field :MGLT, types.Int do |
| 32 | + description " |
| 33 | + The Maximum number of Megalights this starship can travel in a standard hour. |
| 34 | + A \"Megalight\" is a standard unit of distance and has never been |
| 35 | + defined before within the Star Wars universe. |
| 36 | + This figure is only really useful for measuring the difference in speed of starships. |
| 37 | + We can assume it is similar to AU, the distance between our Sun (Sol) and Earth. |
| 38 | + " |
| 39 | + property :mglt |
| 40 | + end |
| 41 | + |
| 42 | + field :cargoCapacity, types.Float do |
| 43 | + description "The maximum number of kilograms that this starship can transport." |
| 44 | + property :cargo_capacity |
| 45 | + end |
| 46 | + |
| 47 | + field :consumables, types.String, "The maximum length of time that this starship can provide consumables for its entire crew without having to resupply." |
| 48 | + field :pilots, types[Graph::Types::Person], "The pilots on this starship." |
| 49 | + |
| 50 | + field :created_at, types.String, "The ISO 8601 date format of the time that this resource was created." |
| 51 | + field :updated_at, types.String, "The ISO 8601 date format of the time that this resource was updated." |
| 52 | + end |
| 53 | + end |
| 54 | +end |
0 commit comments