UNPKG

graphql-mocks

Version:

Tools for setting up graphql test resolvers

14 lines (13 loc) 682 B
import { Highlight } from '../highlight.mjs'; import { reference } from '../highlighter/reference.mjs'; function coerceHighlight(schema, coercible) { if (coercible instanceof Highlight) return coercible; if (Array.isArray(coercible)) return new Highlight(schema).include(reference(...coercible)); if (typeof coercible === 'function') { var h = new Highlight(schema); return coercible(h); } throw new Error("Unable to coerce highlight, got ".concat(typeof coercible, ". Must be either an array of References, ") + "a callback that receives a Highlight instance, or a Highlight instance"); } export { coerceHighlight }; //# sourceMappingURL=coerce-highlight.mjs.map