From 693fece04b04d56e242e79f13aed14c5bd294962 Mon Sep 17 00:00:00 2001 From: Max Ehrlicher-Schmidt Date: Tue, 24 Nov 2020 19:34:51 +0100 Subject: [PATCH] Fix Referencetable --- src/app/graphqlOperations/bike.graphql | 6 +-- .../pages/dataPages/bike/bike.component.html | 1 - src/generated/graphql.schema.json | 48 ++++++++++++++--- src/generated/graphql.ts | 53 +++++++++++-------- 4 files changed, 75 insertions(+), 33 deletions(-) diff --git a/src/app/graphqlOperations/bike.graphql b/src/app/graphqlOperations/bike.graphql index d031b82..d96a3cf 100644 --- a/src/app/graphqlOperations/bike.graphql +++ b/src/app/graphqlOperations/bike.graphql @@ -24,19 +24,19 @@ mutation CreateCargoBike($bike: CargoBikeCreateInput!) { mutation UpdateCargoBike($bike: CargoBikeUpdateInput!) { updateCargoBike(cargoBike: $bike) { - ...CargoBikeFieldsForTable + ...CargoBikeFieldsForPage } } mutation LockCargoBike($id: ID!) { lockCargoBike(id: $id) { - ...CargoBikeFieldsForTable + ...CargoBikeFieldsForPage } } mutation UnlockCargoBike($id: ID!) { unlockCargoBike(id: $id) { - ...CargoBikeFieldsForTable + ...CargoBikeFieldsForPage } } diff --git a/src/app/pages/dataPages/bike/bike.component.html b/src/app/pages/dataPages/bike/bike.component.html index b5b5773..f84bcad 100644 --- a/src/app/pages/dataPages/bike/bike.component.html +++ b/src/app/pages/dataPages/bike/bike.component.html @@ -4,7 +4,6 @@ [headlineDataPath]="headlineDataPath" [pageDataGQLType]="pageDataGQLType" [pageDataGQLUpdateInputType]="pageDataGQLUpdateInputType" - [propertyNameOfUpdateInput]="propertyNameOfUpdateInput" (lockEvent)="lock($event)" (saveEvent)="save($event)" (cancelEvent)="cancel($event)" diff --git a/src/generated/graphql.schema.json b/src/generated/graphql.schema.json index 1972f54..75b4c9c 100644 --- a/src/generated/graphql.schema.json +++ b/src/generated/graphql.schema.json @@ -651,7 +651,7 @@ }, { "name": "security", - "description": "Safety is a custom type, that stores information about security features.\nTODO: Should this be called Security?", + "description": "Safety is a custom type, that stores information about security features.", "type": { "kind": "NON_NULL", "name": null, @@ -693,7 +693,21 @@ }, { "name": "equipmentTypeIds", - "description": "Refers to equipment that is not unique. See kommentierte info tabelle -> Fragen -> Frage 2", + "description": "Refers to equipment that is not unique. See kommentierte info tabelle -> Fragen -> Frage 2\nWhen set to null or [], no relations will be added.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "equipmentIds", + "description": "Refers to unique equipment\nWhen set to null or [], no relations will be added.", "type": { "kind": "LIST", "name": null, @@ -771,7 +785,7 @@ { "kind": "INPUT_OBJECT", "name": "CargoBikeUpdateInput", - "description": "if you want to add bike to a lending station, create a new timeFrame with to: Date = null", + "description": "If you want to add bike to a lending station, create a new timeFrame with to: Date = null", "fields": null, "inputFields": [ { @@ -860,7 +874,7 @@ }, { "name": "security", - "description": "Safety is a custom type, that stores information about security features.\nTODO: Should this be called Security?", + "description": "Safety is a custom type, that stores information about security features.", "type": { "kind": "INPUT_OBJECT", "name": "SecurityUpdateInput", @@ -890,7 +904,21 @@ }, { "name": "equipmentTypeIds", - "description": "Refers to equipment that is not unique. See kommentierte info tabelle -> Fragen -> Frage 2\nIf set, ols relations will be over written. Set [] to delete all", + "description": "Refers to equipment that is not unique. See kommentierte info tabelle -> Fragen -> Frage 2\nWhen set to null, field will be ignored.\nWhen set to [], all relations will be deleted.\nElse all realtions will be deleted and the specified relations will be added.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "equipmentIds", + "description": "Refers to unique equipment\nWhen set to null, field will be ignored.\nWhen set to [], all relations will be deleted.\nElse all realtions will be deleted and the specified relations will be added.", "type": { "kind": "LIST", "name": null, @@ -4488,9 +4516,13 @@ "name": "name", "description": null, "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } }, "defaultValue": null }, diff --git a/src/generated/graphql.ts b/src/generated/graphql.ts index 4ce2fbf..5f9aed1 100644 --- a/src/generated/graphql.ts +++ b/src/generated/graphql.ts @@ -109,17 +109,22 @@ export type CargoBikeCreateInput = { forCargo: Scalars['Boolean']; forChildren: Scalars['Boolean']; numberOfChildren: Scalars['Int']; - /** - * Safety is a custom type, that stores information about security features. - * TODO: Should this be called Security? - */ + /** Safety is a custom type, that stores information about security features. */ security: SecurityCreateInput; /** Does not refer to an extra table in the database. */ technicalEquipment: TechnicalEquipmentCreateInput; /** Does not refer to an extra table in the database. */ dimensionsAndLoad: DimensionsAndLoadCreateInput; - /** Refers to equipment that is not unique. See kommentierte info tabelle -> Fragen -> Frage 2 */ + /** + * Refers to equipment that is not unique. See kommentierte info tabelle -> Fragen -> Frage 2 + * When set to null or [], no relations will be added. + */ equipmentTypeIds?: Maybe>>; + /** + * Refers to unique equipment + * When set to null or [], no relations will be added. + */ + equipmentIds?: Maybe>>; /** Sticker State */ stickerBikeNameState?: Maybe; note?: Maybe; @@ -128,7 +133,7 @@ export type CargoBikeCreateInput = { taxes: TaxesCreateInput; }; -/** if you want to add bike to a lending station, create a new timeFrame with to: Date = null */ +/** If you want to add bike to a lending station, create a new timeFrame with to: Date = null */ export type CargoBikeUpdateInput = { id: Scalars['ID']; /** see column A in info tabelle */ @@ -139,10 +144,7 @@ export type CargoBikeUpdateInput = { forCargo?: Maybe; forChildren?: Maybe; numberOfChildren?: Maybe; - /** - * Safety is a custom type, that stores information about security features. - * TODO: Should this be called Security? - */ + /** Safety is a custom type, that stores information about security features. */ security?: Maybe; /** Does not refer to an extra table in the database. */ technicalEquipment?: Maybe; @@ -150,9 +152,18 @@ export type CargoBikeUpdateInput = { dimensionsAndLoad?: Maybe; /** * Refers to equipment that is not unique. See kommentierte info tabelle -> Fragen -> Frage 2 - * If set, ols relations will be over written. Set [] to delete all + * When set to null, field will be ignored. + * When set to [], all relations will be deleted. + * Else all realtions will be deleted and the specified relations will be added. */ equipmentTypeIds?: Maybe>>; + /** + * Refers to unique equipment + * When set to null, field will be ignored. + * When set to [], all relations will be deleted. + * Else all realtions will be deleted and the specified relations will be added. + */ + equipmentIds?: Maybe>>; /** Sticker State */ stickerBikeNameState?: Maybe; note?: Maybe; @@ -613,7 +624,7 @@ export type EquipmentType = { }; export type EquipmentTypeCreateInput = { - name?: Maybe; + name: Scalars['String']; description?: Maybe; }; @@ -1783,7 +1794,7 @@ export type UpdateCargoBikeMutation = ( { __typename?: 'Mutation' } & { updateCargoBike: ( { __typename?: 'CargoBike' } - & CargoBikeFieldsForTableFragment + & CargoBikeFieldsForPageFragment ) } ); @@ -1796,7 +1807,7 @@ export type LockCargoBikeMutation = ( { __typename?: 'Mutation' } & { lockCargoBike: ( { __typename?: 'CargoBike' } - & CargoBikeFieldsForTableFragment + & CargoBikeFieldsForPageFragment ) } ); @@ -1809,7 +1820,7 @@ export type UnlockCargoBikeMutation = ( { __typename?: 'Mutation' } & { unlockCargoBike: ( { __typename?: 'CargoBike' } - & CargoBikeFieldsForTableFragment + & CargoBikeFieldsForPageFragment ) } ); @@ -2449,10 +2460,10 @@ export const CreateCargoBikeDocument = gql` export const UpdateCargoBikeDocument = gql` mutation UpdateCargoBike($bike: CargoBikeUpdateInput!) { updateCargoBike(cargoBike: $bike) { - ...CargoBikeFieldsForTable + ...CargoBikeFieldsForPage } } - ${CargoBikeFieldsForTableFragmentDoc}`; + ${CargoBikeFieldsForPageFragmentDoc}`; @Injectable({ providedIn: 'root' @@ -2467,10 +2478,10 @@ export const UpdateCargoBikeDocument = gql` export const LockCargoBikeDocument = gql` mutation LockCargoBike($id: ID!) { lockCargoBike(id: $id) { - ...CargoBikeFieldsForTable + ...CargoBikeFieldsForPage } } - ${CargoBikeFieldsForTableFragmentDoc}`; + ${CargoBikeFieldsForPageFragmentDoc}`; @Injectable({ providedIn: 'root' @@ -2485,10 +2496,10 @@ export const LockCargoBikeDocument = gql` export const UnlockCargoBikeDocument = gql` mutation UnlockCargoBike($id: ID!) { unlockCargoBike(id: $id) { - ...CargoBikeFieldsForTable + ...CargoBikeFieldsForPage } } - ${CargoBikeFieldsForTableFragmentDoc}`; + ${CargoBikeFieldsForPageFragmentDoc}`; @Injectable({ providedIn: 'root'