|
19 | 19 |
|
20 | 20 | import { Neo4jGraphQLSchemaValidationError } from "../../classes"; |
21 | 21 | import type { RelationshipNestedOperationsOption, RelationshipQueryDirectionOption } from "../../constants"; |
22 | | -import { upperFirst } from "../../utils/upper-first"; |
23 | 22 | import type { Annotations } from "../annotation/Annotation"; |
24 | 23 | import type { Argument } from "../argument/Argument"; |
25 | 24 | import type { Attribute } from "../attribute/Attribute"; |
@@ -116,56 +115,18 @@ export class Relationship { |
116 | 115 | } |
117 | 116 | } |
118 | 117 |
|
119 | | - public clone(): Relationship { |
120 | | - return new Relationship({ |
121 | | - name: this.name, |
122 | | - type: this.type, |
123 | | - args: this.args, |
124 | | - attributes: Array.from(this.attributes.values()).map((a) => a.clone()), |
125 | | - source: this.source, |
126 | | - target: this.target, |
127 | | - direction: this.direction, |
128 | | - isList: this.isList, |
129 | | - queryDirection: this.queryDirection, |
130 | | - nestedOperations: this.nestedOperations, |
131 | | - aggregate: this.aggregate, |
132 | | - isNullable: this.isNullable, |
133 | | - description: this.description, |
134 | | - annotations: this.annotations, |
135 | | - propertiesTypeName: this.propertiesTypeName, |
136 | | - firstDeclaredInTypeName: this.firstDeclaredInTypeName, |
137 | | - originalTarget: this.originalTarget, |
138 | | - siblings: this.siblings, |
139 | | - }); |
140 | | - } |
141 | | - |
142 | 118 | private addAttribute(attribute: Attribute): void { |
143 | 119 | if (this.attributes.has(attribute.name)) { |
144 | 120 | throw new Neo4jGraphQLSchemaValidationError(`Attribute ${attribute.name} already exists in ${this.name}.`); |
145 | 121 | } |
146 | 122 | this.attributes.set(attribute.name, attribute); |
147 | 123 | } |
148 | 124 |
|
149 | | - public findAttribute(name: string): Attribute | undefined { |
150 | | - return this.attributes.get(name); |
151 | | - } |
152 | | - |
153 | 125 | public setSiblings(siblingPropertiesTypeNames: string[]) { |
154 | 126 | this.siblings = siblingPropertiesTypeNames; |
155 | 127 | } |
156 | 128 |
|
157 | 129 | public getSiblings(): string[] | undefined { |
158 | 130 | return this.siblings; |
159 | 131 | } |
160 | | - |
161 | | - // TODO: Remove connectionFieldTypename and relationshipFieldTypename and delegate to the adapter |
162 | | - /**Note: Required for now to infer the types without ResolveTree */ |
163 | | - public get connectionFieldTypename(): string { |
164 | | - return `${this.source.name}${upperFirst(this.name)}Connection`; |
165 | | - } |
166 | | - |
167 | | - /**Note: Required for now to infer the types without ResolveTree */ |
168 | | - public get relationshipFieldTypename(): string { |
169 | | - return `${this.source.name}${upperFirst(this.name)}Relationship`; |
170 | | - } |
171 | 132 | } |
0 commit comments