Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_buildField(attr) {
return new Type.Field(this.normalizeCaseFn(attr));
}
field = new Type.Field(
this.normalizeCaseFn(relName),
null,
new Type.ArgumentSet(),
new Type.SelectionSet()
);
this.agenda.push({ name: relName, model: relModel, field });
}
}
if (field) {
currentField.selectionSet.push(field);
}
});
}
} else {
rootField.selectionSet.push(new Type.Field('id'));
}
operation.selectionSet.push(rootField);
return operation;
}
currentModel.eachRelationship((relName, relationship) => {
let field;
let { type, options } = relationship;
if (options.async) {
field = this._buildAsyncRelationship(relName, relationship);
} else {
let relModel = store.modelFor(type);
if (this.visited.indexOf(relName) === -1) {
field = new Type.Field(
this.normalizeCaseFn(relName),
null,
new Type.ArgumentSet(),
new Type.SelectionSet()
);
this.agenda.push({ name: relName, model: relModel, field });
}
}
if (field) {
currentField.selectionSet.push(field);
}
});
}