{"_id":"@dmn-arc-core-components/content-schema_ans-feed-v0.6.2","_rev":"3-ef86e63d9c8b3ae33fb7fe814679f946","name":"@dmn-arc-core-components/content-schema_ans-feed-v0.6.2","dist-tags":{"latest":"1.0.0-alpha"},"versions":{"1.0.0-alpha":{"name":"@dmn-arc-core-components/content-schema_ans-feed-v0.6.2","version":"1.0.0-alpha","description":"GraphQL schema for use with any content source returning a feed of ANS stories.","main":"build/index.js","repository":{"type":"git","url":"https://github.com/dallasnews/dmn-arc-core-components/packages/content-schema_ans-feed-v0.6.2"},"author":{"name":"Matt Nelson"},"license":"ISC","publishConfig":{"access":"public"},"dependencies":{"@babel/runtime":"^7.4.3"},"_id":"@dmn-arc-core-components/content-schema_ans-feed-v0.6.2@1.0.0-alpha","_nodeVersion":"15.14.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-162yzTb2LLJkdnOHAI0s+l9J2Z7yvNAcL5Ymn7MOKe+WqYMN9RDemuSXVx9SH5pHyp4dC64vc2SpE6BSI0TwWA==","shasum":"6f8a8c847b0fb777acf4016f4f09147fc4c99571","tarball":"https://registry.npmjs.org/@dmn-arc-core-components/content-schema_ans-feed-v0.6.2/-/content-schema_ans-feed-v0.6.2-1.0.0-alpha.tgz","fileCount":8,"unpackedSize":594454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzw5lCRA9TVsSAnZWagAAF4UQAJgvM/uuNII+93366l52\nmwS/aRvbdf7M2ejVML42/0qqW49RbOHfzNSVFRsHuVn/lA+SStBaOO5L+fkK\nBRf44YiCWM3jrLy0uVGZOEYOwnLwQISaUp3me4FJZGJDIV7RIYMaS434VVxj\nke5/lrspRiSZxxfKCt1PSLFEHz9/qMp+tboPVgxudfZo6J1h0xQq7xb9cWfj\n+mgDIXC5JxIHUbTFQjCwIGafXLzvjdAwoFiw78+Lxiad7u8iHq0Km+a8tBtQ\nA4EFIOPi7IEMY203mnu1zLV6tM54DNoL/jBiXRuDEnKheip3FePMww3NDOkB\nFW4meYnkxPCnRqaua1L2Aktzbm0L6C8OIXKkckKnP5j85NEipEnwBErct9Fm\nZUnIj/d2nYal38ljenzG0djkVnNUacAmsOumXg0FwnP/+foP60mCir4MDRMb\nLwx+JeQNKrrRsCkGTpeOrXMtvgCOChf6yMkl0Lq3fymWUTqliQeKDPAFlb/5\nlkO3F8V3z55h2WBhNpZ1VCNBRfwzepD8HCH63SYFNgjaHkIyWqiVG6Z06Bti\nvMMBWgrhbiC1MmhXVYmfN6Ao0U2+K3600kIaa8X2BcBccxYFrXsw37W+GtBE\neY/FiVRPjRAXUNF5s+/o3DwOjN2PZ3YKZA5WonDNJxSSfnozWuB36M08c/BM\nuL8e\r\n=A85O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZfVOoR+hY3bpm0Ibtj375rWpa9qcmUjUg7XguClOKEQIhAL6+4BIaTdVxY1lRRfEUUh2wtpBEJ9HMOdrGevk8CEZQ"}]},"_npmUser":{"name":"jfoxworth","email":"jfoxworth@cadwolf.com"},"directories":{},"maintainers":[{"name":"jfoxworth","email":"jfoxworth@cadwolf.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/content-schema_ans-feed-v0.6.2_1.0.0-alpha_1636076589454_0.3006829035285896"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-05T01:43:09.408Z","1.0.0-alpha":"2021-11-05T01:43:09.688Z","modified":"2022-04-05T05:00:13.648Z"},"maintainers":[{"email":"mike.dilley@gmail.com","name":"mddilley"},{"email":"jfoxworth@cadwolf.com","name":"jfoxworth"}],"description":"GraphQL schema for use with any content source returning a feed of ANS stories.","repository":{"type":"git","url":"https://github.com/dallasnews/dmn-arc-core-components/packages/content-schema_ans-feed-v0.6.2"},"author":{"name":"Matt Nelson"},"license":"ISC","readme":"# Content Schema: ANS Feed (0.6.2)\n\nThis the Arc Core Component representing a GraphQL schema that can be used with\na content source.\n\n## Context\n\nhttps://graphql.org/learn/\n\nA GraphQL schema defines all potential queries possible against a content\nsource, using strongly typed field definitions.\n\nQueries are executed using GraphQL filters, subsets of the fields defined in the\nschema, per content source call, in the form of a URL `filter` param, ex:\n\n`/content/v4/search/?size=10&filter=content_elements%20{%20canonical_url%20description%20{%20basic%20}}`\n\nOnly those fields specified per filter are returned to the client, reducing\npayload, without requiring custom endpoints.\n\nSchemas can be large, filters should be small.\n\n## Getting started\n\nThis Core Component must be used within a Fusion project.\n\nIt should be used for any feature showing a feed of ANS stories (`Flex Feed`,\n`Section Feed`, `Recirc Feed`, etc).\n\n1. Add this schema as a dependency of the repo.\n   `npm install @dmn-arc-core-components/content-schema_ans-feed-v0.6.2`\n2. Create a file of your desired schema name within the `/schemas` folder. For\n   this content source, the suggested name is `ans-feed.js`\n3. This is the name you should use when referencing this schema in any content\n   config within a custom field.\n4. Paste the following into `ans-feed.js`:\n\n```javascript\nimport schema from \"@dmn-arc-core-components/content-schema_ans-feed-v0.6.2\";\n\nexport default schema;\n```\n\n## How to use\n\nAdd the `ans-feed` schema to your Fusion Content Source:\n\n![](2019-03-03-14-32-07.png)\n\nIn every Fusion data request (`getContent`, `fetchContent`), pass a `filter`\nobject as the 3rd param:\n\n![](2019-03-03-14-56-41.png)\n\nExample of an ANS Feed filter (`/filters/ansFeedFilter.js`):\n\n```javascript\nexport default `\n{\n  content_elements {\n    canonical_url\n    description {\n      basic\n    }\n    headlines {\n      basic\n    }\n    promo_items {\n      basic {\n        type\n        url\n      }\n    }\n    taxonomy {\n      primary_section {\n        name\n      }\n    }\n    credits {\n      by {\n        name\n        image {\n          url\n        }\n        slug\n      }\n    }\n  }\n}\n`;\n```\n\n## Fusion Data Viewer\n\n1. Run the following utility in your browser console (based on Fusion version):\n\n   /core-components/documentation/utilities/fusionDataViewer2.0.js </br>\n   /core-components/documentation/utilities/fusionDataViewer2.1.js\n\n2. Click the `Content Cache` button to see the summarized JSON returned to the\n   page\n\nNote: To view the difference in data returned, without running a script, simply\nright click -> View Page Source, to see the JSON data loaded onto the page.\n\n## Results\n\nComparison of data returned from the same Section page:\n\n#### ANS payload _without_ GraphQL Filters (all fields returned) -\n\n![](2019-03-03-15-12-22.png)\n\n#### ANS payload _with_ GraphQL Filters (only filter fields returned) -\n\n![](2019-03-03-15-07-58.png)\n\n## Summary\n\n#### Page size reduced by ~2.3mb\n","readmeFilename":"README.md"}