UNPKG

graphql-mocks

Version:
17 lines (12 loc) 418 B
import { isNonNullType, isListType } from 'graphql'; function listItemType(type) { if (isNonNullType(type)) { return listItemType(type.ofType); } if (!isListType(type)) { throw new Error("Tried to get list item type but ".concat(type.name, " is not a list")); } return type === null || type === void 0 ? void 0 : type.ofType; } export { listItemType }; //# sourceMappingURL=list-item-type.js.map