{"action":"created","issue":{"url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/593","repository_url":"https://api.github.com/repos/wp-graphql/wp-graphql","labels_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/593/labels{/name}","comments_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/593/comments","events_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/593/events","html_url":"https://github.com/wp-graphql/wp-graphql/pull/593","id":386418027,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1MTY2NjQz","number":593,"title":"#326 - Revision Support","user":{"login":"jasonbahl","id":1260765,"node_id":"MDQ6VXNlcjEyNjA3NjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1260765?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonbahl","html_url":"https://github.com/jasonbahl","followers_url":"https://api.github.com/users/jasonbahl/followers","following_url":"https://api.github.com/users/jasonbahl/following{/other_user}","gists_url":"https://api.github.com/users/jasonbahl/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonbahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonbahl/subscriptions","organizations_url":"https://api.github.com/users/jasonbahl/orgs","repos_url":"https://api.github.com/users/jasonbahl/repos","events_url":"https://api.github.com/users/jasonbahl/events{/privacy}","received_events_url":"https://api.github.com/users/jasonbahl/received_events","type":"User","site_admin":false},"labels":[{"id":545065976,"node_id":"MDU6TGFiZWw1NDUwNjU5NzY=","url":"https://api.github.com/repos/wp-graphql/wp-graphql/labels/Architecture","name":"Architecture","color":"0052cc","default":false},{"id":722721871,"node_id":"MDU6TGFiZWw3MjI3MjE4NzE=","url":"https://api.github.com/repos/wp-graphql/wp-graphql/labels/Breaking%20Change","name":"Breaking Change","color":"f21a69","default":false},{"id":545066258,"node_id":"MDU6TGFiZWw1NDUwNjYyNTg=","url":"https://api.github.com/repos/wp-graphql/wp-graphql/labels/Tests","name":"Tests","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":{"login":"jasonbahl","id":1260765,"node_id":"MDQ6VXNlcjEyNjA3NjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1260765?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonbahl","html_url":"https://github.com/jasonbahl","followers_url":"https://api.github.com/users/jasonbahl/followers","following_url":"https://api.github.com/users/jasonbahl/following{/other_user}","gists_url":"https://api.github.com/users/jasonbahl/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonbahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonbahl/subscriptions","organizations_url":"https://api.github.com/users/jasonbahl/orgs","repos_url":"https://api.github.com/users/jasonbahl/repos","events_url":"https://api.github.com/users/jasonbahl/events{/privacy}","received_events_url":"https://api.github.com/users/jasonbahl/received_events","type":"User","site_admin":false},"assignees":[{"login":"jasonbahl","id":1260765,"node_id":"MDQ6VXNlcjEyNjA3NjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1260765?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonbahl","html_url":"https://github.com/jasonbahl","followers_url":"https://api.github.com/users/jasonbahl/followers","following_url":"https://api.github.com/users/jasonbahl/following{/other_user}","gists_url":"https://api.github.com/users/jasonbahl/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonbahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonbahl/subscriptions","organizations_url":"https://api.github.com/users/jasonbahl/orgs","repos_url":"https://api.github.com/users/jasonbahl/repos","events_url":"https://api.github.com/users/jasonbahl/events{/privacy}","received_events_url":"https://api.github.com/users/jasonbahl/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-12-01T03:37:42Z","updated_at":"2018-12-01T03:43:57Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/593","html_url":"https://github.com/wp-graphql/wp-graphql/pull/593","diff_url":"https://github.com/wp-graphql/wp-graphql/pull/593.diff","patch_url":"https://github.com/wp-graphql/wp-graphql/pull/593.patch"},"body":"### Your checklist for this pull request\r\nThanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.\r\n\r\n🚨Please review the [guidelines for contributing](../CONTRIBUTING.md) to this repository.\r\n\r\n- [x] Make sure you are making a pull request against the **develop branch** (left side). Also you should start *your branch* off *our develop*.\r\n- [x] Make sure you are requesting to pull request from a **topic/feature/bugfix branch** (right side). Don't pull request from your master!\r\n\r\nWhat does this implement/fix? Explain your changes.\r\n---------------------------------------------------\r\n- This adds revision support, including full respect for capability checks.\r\n- TypeRegistry.php - adds a new `connectionFieldConfig` field to allow additional config to be passed to the root connection field when registering a connection\r\n- Unset status and stati $args for Revision connections\r\n- Remove the filter that was previously added to Config.php to attempt to restrict revisions\r\n- Update DataSource::resolve_post_object(); to call the new PostObject model, which returns a PostObject in the correct shape, and handles all the cap checks in a central place\r\n- Update PostObjectConnectionResolver to ensure both nodes and edges resolve the PostObject properly before being returned.\r\n- Introduce a new PostObject model which handles permission checking before returning a PostObject\r\n- Move resolvers out of the Type/Object/PostObject definition and into the Model/PostObject\r\n- run composer install --no-dev && composer dump-autoload\r\n\r\nDoes this close any currently open issues?\r\n------------------------------------------\r\n#326 (follow-up to #588) \r\n\r\nAny relevant logs, error output, GraphiQL screenshots, etc?\r\n-------------------------------------\r\n**Authenticated Admin user querying for Revisions**\r\n\r\n![revisions-auth-admin](https://user-images.githubusercontent.com/1260765/49323854-d13b2a00-f4df-11e8-8430-a4b8b22895be.gif)\r\n\r\n**Authenticated Author querying for Revisions**\r\n\r\n![revisions-authenticated-author](https://user-images.githubusercontent.com/1260765/49323856-d6987480-f4df-11e8-951f-444a84515e59.gif)\r\n\r\n**Unauthenticated user Querying for revisions**\r\n\r\n![revisions-no-auth](https://user-images.githubusercontent.com/1260765/49323859-da2bfb80-f4df-11e8-9b0b-45479659f9b6.gif)\r\n\r\n\r\nAny other comments?\r\n-------------------\r\n\r\nThis lays some foundation for handling better auth checks in a more centralized way. \r\n\r\nI think there's more work that can be done still, but this lays some initial foundation so that we can handle permissions for objects in a central manner. \r\n\r\nA PostObject can be referenced from many Types in the Schema, so instead of defining cap checks over and over and over within resolvers, we can now define them in the Model layer, and let the Types resolve to the Model layer. \r\n\r\nOver time I see more and more Models being created for core entities. . . Comments, MediaItems, User, etc. \r\n\r\nThis will allow for the Schema to better mirror UI needs and have less of a 1-to-1 mirror of the data storage as well. 😄 "},"comment":{"url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/comments/443396443","html_url":"https://github.com/wp-graphql/wp-graphql/pull/593#issuecomment-443396443","issue_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/593","id":443396443,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzM5NjQ0Mw==","user":{"login":"codecov[bot]","id":22429695,"node_id":"MDM6Qm90MjI0Mjk2OTU=","avatar_url":"https://avatars2.githubusercontent.com/in/254?v=4","gravatar_id":"","url":"https://api.github.com/users/codecov%5Bbot%5D","html_url":"https://github.com/apps/codecov","followers_url":"https://api.github.com/users/codecov%5Bbot%5D/followers","following_url":"https://api.github.com/users/codecov%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/codecov%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/codecov%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/codecov%5Bbot%5D/repos","events_url":"https://api.github.com/users/codecov%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/codecov%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-12-01T03:43:57Z","updated_at":"2018-12-01T03:43:57Z","author_association":"NONE","body":"# [Codecov](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593?src=pr&el=h1) Report\n> Merging [#593](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593?src=pr&el=desc) into [develop](https://codecov.io/gh/wp-graphql/wp-graphql/commit/d14c14c60571ed81291e887554025654cb4ef085?src=pr&el=desc) will **decrease** coverage by `0.15%`.\n> The diff coverage is `78.54%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/graphs/tree.svg?width=650&token=icWovxmipe&height=150&src=pr)](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593?src=pr&el=tree)\n\n```diff\n@@             Coverage Diff             @@\n##           develop     #593      +/-   ##\n===========================================\n- Coverage    59.28%   59.13%   -0.16%     \n===========================================\n  Files          107      108       +1     \n  Lines         6641     6724      +83     \n===========================================\n+ Hits          3937     3976      +39     \n- Misses        2704     2748      +44\n```\n\n\n| [Impacted Files](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/Type/Object/RootQuery.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL1R5cGUvT2JqZWN0L1Jvb3RRdWVyeS5waHA=) | `50.51% <ø> (ø)` | :arrow_up: |\n| [src/Data/Config.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL0RhdGEvQ29uZmlnLnBocA==) | `65% <ø> (-4.02%)` | :arrow_down: |\n| [src/Types.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL1R5cGVzLnBocA==) | `44.34% <100%> (+0.48%)` | :arrow_up: |\n| [src/Data/DataSource.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL0RhdGEvRGF0YVNvdXJjZS5waHA=) | `81.25% <100%> (-0.82%)` | :arrow_down: |\n| [src/Type/Object/MenuItem.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL1R5cGUvT2JqZWN0L01lbnVJdGVtLnBocA==) | `53.4% <100%> (ø)` | :arrow_up: |\n| [src/Utils/InstrumentSchema.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL1V0aWxzL0luc3RydW1lbnRTY2hlbWEucGhw) | `96.36% <100%> (ø)` | :arrow_up: |\n| [src/Data/MenuItemConnectionResolver.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL0RhdGEvTWVudUl0ZW1Db25uZWN0aW9uUmVzb2x2ZXIucGhw) | `76.78% <100%> (ø)` | :arrow_up: |\n| [src/Type/Object/PostObject.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL1R5cGUvT2JqZWN0L1Bvc3RPYmplY3QucGhw) | `42.48% <33.33%> (-21.32%)` | :arrow_down: |\n| [src/Connection/PostObjects.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL0Nvbm5lY3Rpb24vUG9zdE9iamVjdHMucGhw) | `49.02% <66.66%> (+0.97%)` | :arrow_up: |\n| [src/TypeRegistry.php](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree#diff-c3JjL1R5cGVSZWdpc3RyeS5waHA=) | `78.22% <75%> (+0.34%)` | :arrow_up: |\n| ... and [5 more](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593/diff?src=pr&el=tree-more) | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593?src=pr&el=footer). Last update [d14c14c...95c2508](https://codecov.io/gh/wp-graphql/wp-graphql/pull/593?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"}}
{"actor":{"display_login":"codecov"}}