{"expireTime":9007200821600205000,"key":"gatsby-plugin-mdx-entire-payload-460b0fc73c8e75c33a140faefcf92be3-","val":{"mdast":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Entity schemas describe where a unique entity can be found in your data shape.","position":{"start":{"line":2,"column":1,"offset":1},"end":{"line":2,"column":79,"offset":79},"indent":[]}}],"position":{"start":{"line":2,"column":1,"offset":1},"end":{"line":2,"column":79,"offset":79},"indent":[]}},{"type":"list","ordered":false,"start":null,"spread":false,"children":[{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"entities must have a unique name.","position":{"start":{"line":4,"column":3,"offset":83},"end":{"line":4,"column":36,"offset":116},"indent":[]}}],"position":{"start":{"line":4,"column":3,"offset":83},"end":{"line":4,"column":36,"offset":116},"indent":[]}}],"position":{"start":{"line":4,"column":1,"offset":81},"end":{"line":4,"column":36,"offset":116},"indent":[]}},{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"entities must have a unique id.","position":{"start":{"line":5,"column":3,"offset":119},"end":{"line":5,"column":34,"offset":150},"indent":[]}}],"position":{"start":{"line":5,"column":3,"offset":119},"end":{"line":5,"column":34,"offset":150},"indent":[]}}],"position":{"start":{"line":5,"column":1,"offset":117},"end":{"line":5,"column":34,"offset":150},"indent":[]}},{"type":"listItem","spread":false,"checked":null,"children":[{"type":"paragraph","children":[{"type":"text","value":"entities must have a shape.","position":{"start":{"line":6,"column":3,"offset":153},"end":{"line":6,"column":30,"offset":180},"indent":[]}}],"position":{"start":{"line":6,"column":3,"offset":153},"end":{"line":6,"column":30,"offset":180},"indent":[]}}],"position":{"start":{"line":6,"column":1,"offset":151},"end":{"line":6,"column":30,"offset":180},"indent":[]}}],"position":{"start":{"line":4,"column":1,"offset":81},"end":{"line":6,"column":30,"offset":180},"indent":[1,1]}},{"type":"heading","depth":2,"children":[{"type":"text","value":"Params","position":{"start":{"line":9,"column":4,"offset":186},"end":{"line":9,"column":10,"offset":192},"indent":[]}}],"position":{"start":{"line":9,"column":1,"offset":183},"end":{"line":9,"column":10,"offset":192},"indent":[]}},{"type":"code","lang":"js","meta":null,"value":"new EntitySchema(\n    name: string,\n    options?: {\n        shape: StructuralSchema,\n        idAttribute: (entity: any) => string\n    }\n);","position":{"start":{"line":11,"column":1,"offset":194},"end":{"line":19,"column":4,"offset":342},"indent":[1,1,1,1,1,1,1,1]}},{"type":"heading","depth":3,"children":[{"type":"text","value":"name","position":{"start":{"line":21,"column":5,"offset":348},"end":{"line":21,"column":9,"offset":352},"indent":[]}}],"position":{"start":{"line":21,"column":1,"offset":344},"end":{"line":21,"column":9,"offset":352},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"type:","position":{"start":{"line":22,"column":3,"offset":355},"end":{"line":22,"column":8,"offset":360},"indent":[]}}],"position":{"start":{"line":22,"column":1,"offset":353},"end":{"line":22,"column":10,"offset":362},"indent":[]}},{"type":"text","value":" ","position":{"start":{"line":22,"column":10,"offset":362},"end":{"line":22,"column":11,"offset":363},"indent":[]}},{"type":"inlineCode","value":"string","position":{"start":{"line":22,"column":11,"offset":363},"end":{"line":22,"column":19,"offset":371},"indent":[]}}],"position":{"start":{"line":22,"column":1,"offset":353},"end":{"line":22,"column":19,"offset":371},"indent":[]}},{"type":"paragraph","children":[{"type":"text","value":"Each category of entity requires a name so that Enty can store and locate them in state.\nIt must be unique amongst your collection of entities.","position":{"start":{"line":24,"column":1,"offset":373},"end":{"line":25,"column":55,"offset":516},"indent":[1]}}],"position":{"start":{"line":24,"column":1,"offset":373},"end":{"line":25,"column":55,"offset":516},"indent":[1]}},{"type":"code","lang":"js","meta":null,"value":"const person = new EntitySchema('person');\nconst cat = new EntitySchema('cat');","position":{"start":{"line":28,"column":1,"offset":519},"end":{"line":31,"column":4,"offset":608},"indent":[1,1,1]}},{"type":"heading","depth":3,"children":[{"type":"text","value":"options.shape","position":{"start":{"line":34,"column":5,"offset":615},"end":{"line":34,"column":18,"offset":628},"indent":[]}}],"position":{"start":{"line":34,"column":1,"offset":611},"end":{"line":34,"column":18,"offset":628},"indent":[]}},{"type":"paragraph","children":[{"type":"strong","children":[{"type":"text","value":"type:","position":{"start":{"line":35,"column":3,"offset":631},"end":{"line":35,"column":8,"offset":636},"indent":[]}}],"position":{"start":{"line":35,"column":1,"offset":629},"end":{"line":35,"column":10,"offset":638},"indent":[]}},{"type":"text","value":" ","position":{"start":{"line":35,"column":10,"offset":638},"end":{"line":35,"column":11,"offset":639},"indent":[]}},{"type":"inlineCode","value":"StructuralSchema","position":{"start":{"line":35,"column":11,"offset":639},"end":{"line":35,"column":29,"offset":657},"indent":[]}}],"position":{"start":{"line":35,"column":1,"offset":629},"end":{"line":35,"column":29,"offset":657},"indent":[]}},{"type":"paragraph","children":[{"type":"text","value":"Because entities can come in many shapes Enty chooses not to define this in the EntitySchema.\nAll EntitySchemas must contain a shape of their shape.","position":{"start":{"line":37,"column":1,"offset":659},"end":{"line":38,"column":55,"offset":807},"indent":[1]}}],"position":{"start":{"line":37,"column":1,"offset":659},"end":{"line":38,"column":55,"offset":807},"indent":[1]}},{"type":"code","lang":"js","meta":null,"value":"const person = new EntitySchema('person', {\n    shape: new ObjectSchema({})\n});\n\nconst globalPersonList = new EntitySchema('globalPersonList', {\n    shape: new ArraySchema(person)\n});","position":{"start":{"line":41,"column":1,"offset":810},"end":{"line":49,"column":4,"offset":1003},"indent":[1,1,1,1,1,1,1,1]}},{"type":"paragraph","children":[{"type":"emphasis","children":[{"type":"text","value":"Note: To allow for schemas with circular structures, shape can be set at any time before execution.","position":{"start":{"line":51,"column":2,"offset":1006},"end":{"line":51,"column":101,"offset":1105},"indent":[]}}],"position":{"start":{"line":51,"column":1,"offset":1005},"end":{"line":51,"column":102,"offset":1106},"indent":[]}}],"position":{"start":{"line":51,"column":1,"offset":1005},"end":{"line":51,"column":102,"offset":1106},"indent":[]}},{"type":"code","lang":"js","meta":null,"value":"const owner = new EntitySchema('owner');\nconst pet = new EntitySchema('pet');\n\ncat.shape = new ObjectSchema({owner});\nowner.shape = new ObjectSchema({pet});","position":{"start":{"line":53,"column":1,"offset":1108},"end":{"line":59,"column":4,"offset":1274},"indent":[1,1,1,1,1,1]}},{"type":"heading","depth":3,"children":[{"type":"text","value":"options.idAttribute","position":{"start":{"line":61,"column":5,"offset":1280},"end":{"line":61,"column":24,"offset":1299},"indent":[]}}],"position":{"start":{"line":61,"column":1,"offset":1276},"end":{"line":61,"column":24,"offset":1299},"indent":[]}},{"type":"jsx","value":"<Id/>","position":{"start":{"line":62,"column":1,"offset":1300},"end":{"line":62,"column":6,"offset":1305},"indent":[]}},{"type":"code","lang":"js","meta":null,"value":"const person = new EntitySchema('person', {\n    idAttribute: (person) => person.email\n});","position":{"start":{"line":64,"column":1,"offset":1307},"end":{"line":68,"column":4,"offset":1406},"indent":[1,1,1,1]}},{"type":"heading","depth":2,"children":[{"type":"text","value":"Methods","position":{"start":{"line":71,"column":4,"offset":1412},"end":{"line":71,"column":11,"offset":1419},"indent":[]}}],"position":{"start":{"line":71,"column":1,"offset":1409},"end":{"line":71,"column":11,"offset":1419},"indent":[]}},{"type":"heading","depth":3,"children":[{"type":"text","value":".normalize()","position":{"start":{"line":73,"column":5,"offset":1425},"end":{"line":73,"column":17,"offset":1437},"indent":[]}}],"position":{"start":{"line":73,"column":1,"offset":1421},"end":{"line":73,"column":17,"offset":1437},"indent":[]}},{"type":"jsx","value":"<Normalize />","position":{"start":{"line":74,"column":1,"offset":1438},"end":{"line":74,"column":14,"offset":1451},"indent":[]}},{"type":"heading","depth":3,"children":[{"type":"text","value":".denormalize()","position":{"start":{"line":76,"column":5,"offset":1457},"end":{"line":76,"column":19,"offset":1471},"indent":[]}}],"position":{"start":{"line":76,"column":1,"offset":1453},"end":{"line":76,"column":19,"offset":1471},"indent":[]}},{"type":"jsx","value":"<Denormalize />","position":{"start":{"line":77,"column":1,"offset":1472},"end":{"line":77,"column":16,"offset":1487},"indent":[]}},{"type":"export","value":"export const _frontmatter = {\"groupRank\":1,\"group\":\"Enty\",\"title\":\"Entity Schema\"}","position":{"start":{"line":80,"column":1,"offset":1490},"end":{"line":80,"column":83,"offset":1572},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":80,"column":83,"offset":1572}}},"scopeImports":["import React from 'react'"],"scopeIdentifiers":["React"],"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"groupRank\": 1,\n  \"group\": \"Enty\",\n  \"title\": \"Entity Schema\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar Id = makeShortcode(\"Id\");\nvar Normalize = makeShortcode(\"Normalize\");\nvar Denormalize = makeShortcode(\"Denormalize\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"Entity schemas describe where a unique entity can be found in your data shape.\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"entities must have a unique name.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"entities must have a unique id.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, \"entities must have a shape.\")), mdx(\"h2\", null, \"Params\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-js\"\n  }), \"new EntitySchema(\\n    name: string,\\n    options?: {\\n        shape: StructuralSchema,\\n        idAttribute: (entity: any) => string\\n    }\\n);\\n\")), mdx(\"h3\", null, \"name\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"type:\"), \" \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"string\")), mdx(\"p\", null, \"Each category of entity requires a name so that Enty can store and locate them in state.\\nIt must be unique amongst your collection of entities.\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-js\"\n  }), \"const person = new EntitySchema('person');\\nconst cat = new EntitySchema('cat');\\n\")), mdx(\"h3\", null, \"options.shape\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"type:\"), \" \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"StructuralSchema\")), mdx(\"p\", null, \"Because entities can come in many shapes Enty chooses not to define this in the EntitySchema.\\nAll EntitySchemas must contain a shape of their shape.\"), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-js\"\n  }), \"const person = new EntitySchema('person', {\\n    shape: new ObjectSchema({})\\n});\\n\\nconst globalPersonList = new EntitySchema('globalPersonList', {\\n    shape: new ArraySchema(person)\\n});\\n\")), mdx(\"p\", null, mdx(\"em\", {\n    parentName: \"p\"\n  }, \"Note: To allow for schemas with circular structures, shape can be set at any time before execution.\")), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-js\"\n  }), \"const owner = new EntitySchema('owner');\\nconst pet = new EntitySchema('pet');\\n\\ncat.shape = new ObjectSchema({owner});\\nowner.shape = new ObjectSchema({pet});\\n\")), mdx(\"h3\", null, \"options.idAttribute\"), mdx(Id, {\n    mdxType: \"Id\"\n  }), mdx(\"pre\", null, mdx(\"code\", _extends({\n    parentName: \"pre\"\n  }, {\n    \"className\": \"language-js\"\n  }), \"const person = new EntitySchema('person', {\\n    idAttribute: (person) => person.email\\n});\\n\")), mdx(\"h2\", null, \"Methods\"), mdx(\"h3\", null, \".normalize()\"), mdx(Normalize, {\n    mdxType: \"Normalize\"\n  }), mdx(\"h3\", null, \".denormalize()\"), mdx(Denormalize, {\n    mdxType: \"Denormalize\"\n  }));\n}\n;\nMDXContent.isMDXComponent = true;","rawMDXOutput":"/* @jsx mdx */\nimport { mdx } from '@mdx-js/react';\n/* @jsx mdx */\n\nexport const _frontmatter = {\n  \"groupRank\": 1,\n  \"group\": \"Enty\",\n  \"title\": \"Entity Schema\"\n};\nconst makeShortcode = name => function MDXDefaultShortcode(props) {\n  console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\")\n  return <div {...props}/>\n};\nconst Id = makeShortcode(\"Id\");\nconst Normalize = makeShortcode(\"Normalize\");\nconst Denormalize = makeShortcode(\"Denormalize\");\nconst layoutProps = {\n  _frontmatter\n};\nconst MDXLayout = \"wrapper\"\nexport default function MDXContent({\n  components,\n  ...props\n}) {\n  return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\"MDXLayout\">\n    <p>{`Entity schemas describe where a unique entity can be found in your data shape.`}</p>\n    <ul>\n      <li parentName=\"ul\">{`entities must have a unique name.`}</li>\n      <li parentName=\"ul\">{`entities must have a unique id.`}</li>\n      <li parentName=\"ul\">{`entities must have a shape.`}</li>\n    </ul>\n    <h2>{`Params`}</h2>\n    <pre><code parentName=\"pre\" {...{\n        \"className\": \"language-js\"\n      }}>{`new EntitySchema(\n    name: string,\n    options?: {\n        shape: StructuralSchema,\n        idAttribute: (entity: any) => string\n    }\n);\n`}</code></pre>\n    <h3>{`name`}</h3>\n    <p><strong parentName=\"p\">{`type:`}</strong>{` `}<inlineCode parentName=\"p\">{`string`}</inlineCode></p>\n    <p>{`Each category of entity requires a name so that Enty can store and locate them in state.\nIt must be unique amongst your collection of entities.`}</p>\n    <pre><code parentName=\"pre\" {...{\n        \"className\": \"language-js\"\n      }}>{`const person = new EntitySchema('person');\nconst cat = new EntitySchema('cat');\n`}</code></pre>\n    <h3>{`options.shape`}</h3>\n    <p><strong parentName=\"p\">{`type:`}</strong>{` `}<inlineCode parentName=\"p\">{`StructuralSchema`}</inlineCode></p>\n    <p>{`Because entities can come in many shapes Enty chooses not to define this in the EntitySchema.\nAll EntitySchemas must contain a shape of their shape.`}</p>\n    <pre><code parentName=\"pre\" {...{\n        \"className\": \"language-js\"\n      }}>{`const person = new EntitySchema('person', {\n    shape: new ObjectSchema({})\n});\n\nconst globalPersonList = new EntitySchema('globalPersonList', {\n    shape: new ArraySchema(person)\n});\n`}</code></pre>\n    <p><em parentName=\"p\">{`Note: To allow for schemas with circular structures, shape can be set at any time before execution.`}</em></p>\n    <pre><code parentName=\"pre\" {...{\n        \"className\": \"language-js\"\n      }}>{`const owner = new EntitySchema('owner');\nconst pet = new EntitySchema('pet');\n\ncat.shape = new ObjectSchema({owner});\nowner.shape = new ObjectSchema({pet});\n`}</code></pre>\n    <h3>{`options.idAttribute`}</h3>\n    <Id mdxType=\"Id\" />\n    <pre><code parentName=\"pre\" {...{\n        \"className\": \"language-js\"\n      }}>{`const person = new EntitySchema('person', {\n    idAttribute: (person) => person.email\n});\n`}</code></pre>\n    <h2>{`Methods`}</h2>\n    <h3>{`.normalize()`}</h3>\n    <Normalize mdxType=\"Normalize\" />\n    <h3>{`.denormalize()`}</h3>\n    <Denormalize mdxType=\"Denormalize\" />\n\n    </MDXLayout>;\n}\n\n;\nMDXContent.isMDXComponent = true;"}}