-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Hey all.
Given I have this schema:
Arrows will generate the following graphql schema:
type Customer {
name: John Smith
orderPlacedBy: Order @relationship(type: "PLACED_BY", direction: IN)
}
type Order {
id: ORD-001
placedByCustomer: Customer @relationship(type: "PLACED_BY", direction: OUT)
productBelongsToOrder: Product @relationship(type: "BELONGS_TO_ORDER", direction: IN)
}
type Product {
name: Wireless Earbuds
price: 79.99
quantity: 1
belongsToOrderOrder: Order @relationship(type: "BELONGS_TO_ORDER", direction: OUT)
}The problem is, that the field types are directly passing thru the value, and not assuming the type, resulting in a parser error if you were to run the schema through the graphql parser.
To fix this, we should have some inference to the right side of the colon so we generate valid graphql syntax.
type Customer {
- name: John Smith
+ name: String
orderPlacedBy: Order @relationship(type: "PLACED_BY", direction: IN)
}
type Order {
- id: ORD-001
+ id: String
placedByCustomer: Customer @relationship(type: "PLACED_BY", direction: OUT)
productBelongsToOrder: Product @relationship(type: "BELONGS_TO_ORDER", direction: IN)
}
type Product {
- name: Wireless Earbuds
+ name: String
- price: 79.99
+ price: Int
- quantity: 1
+ quantity: Int
belongsToOrderOrder: Order @relationship(type: "BELONGS_TO_ORDER", direction: OUT)
}Metadata
Metadata
Assignees
Labels
No labels