Skip to content

VSpec exporter skips fields found in multiple types #152

@ahmdmhd

Description

@ahmdmhd

Given the following GraphQL schema:

enum RowEnum {
  ROW1
  ROW2
}

enum SideEnum {
  DRIVERSIDE
  PASSENGERSIDE
}

type DoorPosition @instanceTag {
  row: RowEnum!
  side: SideEnum!
}

type Door {
  isLocked: Boolean
  position: Int @range(min: 0, max: 100)
  instanceTag: DoorPosition
}

type Vehicle {
  doors: [Door] @noDuplicates
  model: String
  year: Int
  features: [String] @noDuplicates @cardinality(min: 1, max: 10)
}

enum SeatRowEnum {
  ROW1
  ROW2
  ROW3
}

enum SeatPositionEnum {
  LEFT
  CENTER
  RIGHT
}

type SeatPosition @instanceTag {
  row: SeatRowEnum!
  position: SeatPositionEnum!
}

type Seat {
  isOccupied: Boolean
  height: Int @range(min: 0, max: 100)
  instanceTag: SeatPosition
}

type Cabin {
  seats: [Seat] @noDuplicates
  doors: [Door] @noDuplicates
  temperature: Float @range(min: -100, max: 100)
}

the following VSpec is exported:

Cabin:
  type: branch

Cabin.Door:
  instances:
  - [ROW1, ROW2]
  - [DRIVERSIDE, PASSENGERSIDE]
  type: branch

Cabin.Door.isLocked:
  datatype: boolean
  description: ''

Cabin.Door.position:
  datatype: int32
  description: ''
  max: 100
  min: 0

Cabin.Seat:
  instances:
  - [ROW1, ROW2, ROW3]
  - [LEFT, CENTER, RIGHT]
  type: branch

Cabin.Seat.height:
  datatype: int32
  description: ''
  max: 100
  min: 0

Cabin.Seat.isOccupied:
  datatype: boolean
  description: ''

Cabin.temperature:
  datatype: float
  description: ''
  max: 100
  min: -100

Vehicle:
  type: branch

Vehicle.features:
  datatype: string
  description: ''

Vehicle.model:
  datatype: string
  description: ''

Vehicle.year:
  datatype: int32
  description: ''

It can be observed that the door property is attached to Cabin but not to Vehicle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions