UNPKG

graphql-mocks

Version:

Tools for setting up graphql test resolvers

15 lines (13 loc) 428 B
'use strict'; 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