UNPKG

graphql-paper

Version:

A flexible in-memory store based on a GraphQL Schema

13 lines (12 loc) 410 B
import { allDocuments } from './all-documents.mjs'; import { getDocumentKey } from '../document/get-document-key.mjs'; function findDocument(data, key) { if (typeof key !== 'string') { key = getDocumentKey(key); } var all = allDocuments(data); var found = all.find(document => getDocumentKey(document) === key); return found; } export { findDocument }; //# sourceMappingURL=find-document.mjs.map