UNPKG

graphql-mocks

Version:
23 lines (16 loc) 498 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var graphql = require('graphql'); function listItemType(type) { if (graphql.isNonNullType(type)) { return listItemType(type.ofType); } if (!graphql.isListType(type)) { throw new Error(`Tried to get list item type but ${type.name} is not a list`); } return type === null || type === void 0 ? void 0 : type.ofType; } exports.listItemType = listItemType; //# sourceMappingURL=list-item-type.js.map