Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private getTypeCasesForSelectionSet(selectionSet: SelectionSet) {
return typeCaseForSelectionSet(
selectionSet,
this.context.options.mergeInFieldsFromFragmentSpreads
);
}
structDeclarationForSelectionSet(
{
structName,
adoptedProtocols = ["GraphQLSelectionSet"],
selectionSet
}: {
structName: string;
adoptedProtocols?: string[];
selectionSet: SelectionSet;
},
outputIndividualFiles: boolean,
before?: Function
) {
const typeCase = typeCaseForSelectionSet(
selectionSet,
!!this.context.options.mergeInFieldsFromFragmentSpreads
);
this.structDeclarationForVariant(
{
structName,
adoptedProtocols,
variant: typeCase.default,
typeCase
},
outputIndividualFiles,
before,
() => {
const variants = typeCase.variants.map(
this.helpers.propertyFromVariant,
private getTypeCasesForSelectionSet(selectionSet: SelectionSet) {
return typeCaseForSelectionSet(
selectionSet,
this.context.options.mergeInFieldsFromFragmentSpreads
);
}