Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
selection.schemaName === EDGES
)
);
});
const edgesItem = Array.isArray(edgesSelection) ? edgesSelection[0] : null;
const nodeSelections =
edgesItem != null &&
typeof edgesItem === "object" &&
edgesItem.nodeSelections instanceof Map
? edgesItem.nodeSelections
: null;
if (nodeSelections == null) {
throw createUserError(
"Cannot generate flow types for connection field, expected an edges " +
"selection.",
[node.loc]
);
}
const edgesFields = Array.from(nodeSelections.values()) as any[];
const edgesType = selectionsToAST(schema, [edgesFields], state, false);
return [
{
key: "__connection",
conditional: true,
value: ts.createTypeReferenceNode("ConnectionReference", [edgesType])
}