Mutations
This commit is contained in:
+19
-3
@@ -7,9 +7,25 @@ extend type Query {
|
||||
aircraftType: [AircraftType] @all(model: "GermanAirlinesVa\\Fleet\\Models\\AircraftType")
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
aircraft: [Aircraft] @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\Aircraft")
|
||||
extend type Subscription {
|
||||
aircraftAdded: Aircraft @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\Aircraft")
|
||||
}
|
||||
|
||||
type Aircraft { name: String! registration: String! }
|
||||
extend type Mutation {
|
||||
addAircraft(
|
||||
aircraft_type_id: ID!,
|
||||
home_airport_id: ID!,
|
||||
name: String!,
|
||||
registration: String!
|
||||
): Aircraft
|
||||
@create(model: "GermanAirlinesVa\\Fleet\\Models\\Aircraft")
|
||||
@broadcast(subscription: "aircraftAdded")
|
||||
}
|
||||
|
||||
type Aircraft {
|
||||
aircraft_type_id: ID!
|
||||
home_airport_id: ID!
|
||||
name: String!
|
||||
registration: String!
|
||||
}
|
||||
type AircraftType { type: String! aircrafts: [Aircraft] @hasMany }
|
||||
|
||||
Reference in New Issue
Block a user