graphql-mocks
Version:
Tools for setting up graphql test resolvers
17 lines (12 loc) • 418 B
JavaScript
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