Skip to content

Commit

Permalink
fix(router): GraphQlParser constructName()
Browse files Browse the repository at this point in the history
  • Loading branch information
kon14 committed Dec 10, 2021
1 parent b3b8370 commit 51813a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/router/src/controllers/ConduitParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export abstract class ConduitParser<ParseResult, ProcessingObject> {
processingObject: ProcessingObject,
input: boolean,
name: string,
fieldName: string,
value: any,
isRequired: boolean,
isArray?: boolean
Expand Down Expand Up @@ -127,6 +128,7 @@ export abstract class ConduitParser<ParseResult, ProcessingObject> {
processingObject,
input,
name,
field,
(fields[field] as any).type,
(fields[field] as any).required
);
Expand All @@ -136,6 +138,7 @@ export abstract class ConduitParser<ParseResult, ProcessingObject> {
processingObject,
input,
name,
field,
fields[field] as any,
false
);
Expand Down Expand Up @@ -194,6 +197,7 @@ export abstract class ConduitParser<ParseResult, ProcessingObject> {
processingObject,
input,
name,
field,
value[0].type,
value[0].required,
true
Expand All @@ -202,7 +206,7 @@ export abstract class ConduitParser<ParseResult, ProcessingObject> {
}
// if array contains an object
else {
this.getResultFromObject(processingObject, input, name, value[0], false, true);
this.getResultFromObject(processingObject, input, name, field, value[0], false, true);
}
return processingObject;
}
Expand Down
5 changes: 3 additions & 2 deletions packages/router/src/controllers/GraphQl/GraphQlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,16 @@ export class GraphQlParser extends ConduitParser<ParseResult, ProcessingObject>
processingObject: ProcessingObject,
input: boolean,
name: string,
fieldName: string,
value: any,
isRequired: boolean = false,
isArray?: boolean
): void {
// object of some kind
let nestedName = this.constructName(name, value);
let nestedName = this.constructName(name, fieldName);
this.constructResolver(name, value);
processingObject.typeString +=
value +
fieldName +
': ' +
` ${isArray ? '[' : ''}` +
nestedName +
Expand Down

0 comments on commit 51813a2

Please sign in to comment.