UNPKG

graphql-paper

Version:

A flexible in-memory store based on a GraphQL Schema

19 lines (17 loc) 682 B
'use strict'; var createDocument = require('./create-document.js'); var generateDocumentKey = require('./generate-document-key.js'); var getDocumentKey = require('./get-document-key.js'); const key = generateDocumentKey.generateDocumentKey(); const nullDocument = Object.freeze(createDocument.createDocument('__NULL_DOCUMENT__', {}, key)); const isNullDocument = documentOrKey => { if (typeof documentOrKey === 'string') { return documentOrKey === key; } else { return getDocumentKey.getDocumentKey(documentOrKey) === key; } }; exports.isNullDocument = isNullDocument; exports.key = key; exports.nullDocument = nullDocument; //# sourceMappingURL=null-document.js.map