{"action":"created","comment":{"url":"https://api.github.com/repos/reactioncommerce/reaction/pulls/comments/174290720","pull_request_review_id":103618899,"id":174290720,"diff_hunk":"@@ -0,0 +1,24 @@\n+import { transformIdFromBase64 } from \"@reactioncommerce/reaction-graphql-utils\";\n+import { userAccountQuery } from \"/imports/plugins/core/accounts/server/methods/userAccountQuery\";\n+\n+/**\n+ * @name account\n+ * @method\n+ * @summary query the Accounts collection and return user account data\n+ * @param {Object} _ - an object containing the result returned from the resolver\n+ * @param {Object} args - an object of arguments to pass to the function\n+ * @param {String} args.id - id of user to query\n+ * @param {Object} context - an object containing the per-request state\n+ * @return {Object} user account object\n+ */\n+export default function account(_, { id }, context) {\n+  // Trasform ID from base64\n+  // Returns an object. Use `.id` to get ID\n+  const idFromBase64 = transformIdFromBase64(id);\n+\n+  // Pass decoded id (idFromBase64.id) and context into userAccountQuery function\n+  const userAccount = userAccountQuery(context, idFromBase64.id);\n+\n+  // Return result of userAccountQuery()","path":"imports/plugins/core/graphql/server/resolvers/account/query/account.js","position":22,"original_position":22,"commit_id":"5eba828f98e58bc098308698af511d145d25fd6d","original_commit_id":"5eba828f98e58bc098308698af511d145d25fd6d","user":{"login":"aldeed","id":3012067,"avatar_url":"https://avatars1.githubusercontent.com/u/3012067?v=4","gravatar_id":"","url":"https://api.github.com/users/aldeed","html_url":"https://github.com/aldeed","followers_url":"https://api.github.com/users/aldeed/followers","following_url":"https://api.github.com/users/aldeed/following{/other_user}","gists_url":"https://api.github.com/users/aldeed/gists{/gist_id}","starred_url":"https://api.github.com/users/aldeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldeed/subscriptions","organizations_url":"https://api.github.com/users/aldeed/orgs","repos_url":"https://api.github.com/users/aldeed/repos","events_url":"https://api.github.com/users/aldeed/events{/privacy}","received_events_url":"https://api.github.com/users/aldeed/received_events","type":"User","site_admin":false},"body":"> // Return result of userAccountQuery()\r\n\r\nIs pretty obvious from just the code. Comment seems unnecessary.","created_at":"2018-03-13T21:29:16Z","updated_at":"2018-03-13T21:42:45Z","html_url":"https://github.com/reactioncommerce/reaction/pull/3991#discussion_r174290720","pull_request_url":"https://api.github.com/repos/reactioncommerce/reaction/pulls/3991","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/reactioncommerce/reaction/pulls/comments/174290720"},"html":{"href":"https://github.com/reactioncommerce/reaction/pull/3991#discussion_r174290720"},"pull_request":{"href":"https://api.github.com/repos/reactioncommerce/reaction/pulls/3991"}}},"pull_request":{"url":"https://api.github.com/repos/reactioncommerce/reaction/pulls/3991","id":174721421,"html_url":"https://github.com/reactioncommerce/reaction/pull/3991","diff_url":"https://github.com/reactioncommerce/reaction/pull/3991.diff","patch_url":"https://github.com/reactioncommerce/reaction/pull/3991.patch","issue_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/3991","number":3991,"state":"open","locked":false,"title":"(feat): Create GraphQL account query","user":{"login":"kieckhafer","id":4482263,"avatar_url":"https://avatars2.githubusercontent.com/u/4482263?v=4","gravatar_id":"","url":"https://api.github.com/users/kieckhafer","html_url":"https://github.com/kieckhafer","followers_url":"https://api.github.com/users/kieckhafer/followers","following_url":"https://api.github.com/users/kieckhafer/following{/other_user}","gists_url":"https://api.github.com/users/kieckhafer/gists{/gist_id}","starred_url":"https://api.github.com/users/kieckhafer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kieckhafer/subscriptions","organizations_url":"https://api.github.com/users/kieckhafer/orgs","repos_url":"https://api.github.com/users/kieckhafer/repos","events_url":"https://api.github.com/users/kieckhafer/events{/privacy}","received_events_url":"https://api.github.com/users/kieckhafer/received_events","type":"User","site_admin":false},"body":"Resolves #3912 \r\nImpact: **minor**  \r\nType: **feature**\r\n\r\n## Issue\r\nCreate an `account` query in GraphQL.\r\n\r\n## Solution\r\nCreate a query with one argument, `id`, which is required, and return an Account associated with this ID, if the user calling the query has the correct permissions.\r\n\r\n## Breaking changes\r\nNone\r\n\r\n## Testing\r\n1. Start up Reaction\r\n2. Open Mongo (Robo 3T), and copy the `id` of any user\r\n3. Use a Base64 encoder (https://www.base64encode.org/) to encode the ID into base64 along with an `account` prefix - `account:{id}` - and copy the encoded value\r\n4. Navigate to `http://localhost:3000/graphiql`\r\n5. Query to find an account from this encoded ID\r\n```\r\n{\r\n   account(id: {encodedId})\r\n}\r\n```\r\n6. Change the query to an incorrect ID, and see you get a \"No account found\" Error message","created_at":"2018-03-13T16:44:53Z","updated_at":"2018-03-13T21:42:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d79bde9fe76abc671cf41a56d6b23a8e9cbb3806","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ticean","id":46928,"avatar_url":"https://avatars0.githubusercontent.com/u/46928?v=4","gravatar_id":"","url":"https://api.github.com/users/ticean","html_url":"https://github.com/ticean","followers_url":"https://api.github.com/users/ticean/followers","following_url":"https://api.github.com/users/ticean/following{/other_user}","gists_url":"https://api.github.com/users/ticean/gists{/gist_id}","starred_url":"https://api.github.com/users/ticean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ticean/subscriptions","organizations_url":"https://api.github.com/users/ticean/orgs","repos_url":"https://api.github.com/users/ticean/repos","events_url":"https://api.github.com/users/ticean/events{/privacy}","received_events_url":"https://api.github.com/users/ticean/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/reactioncommerce/reaction/pulls/3991/commits","review_comments_url":"https://api.github.com/repos/reactioncommerce/reaction/pulls/3991/comments","review_comment_url":"https://api.github.com/repos/reactioncommerce/reaction/pulls/comments{/number}","comments_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/3991/comments","statuses_url":"https://api.github.com/repos/reactioncommerce/reaction/statuses/5eba828f98e58bc098308698af511d145d25fd6d","head":{"label":"reactioncommerce:feat-3912-kieckhafer-createGraphqlAccountQuery","ref":"feat-3912-kieckhafer-createGraphqlAccountQuery","sha":"5eba828f98e58bc098308698af511d145d25fd6d","user":{"login":"reactioncommerce","id":5605462,"avatar_url":"https://avatars0.githubusercontent.com/u/5605462?v=4","gravatar_id":"","url":"https://api.github.com/users/reactioncommerce","html_url":"https://github.com/reactioncommerce","followers_url":"https://api.github.com/users/reactioncommerce/followers","following_url":"https://api.github.com/users/reactioncommerce/following{/other_user}","gists_url":"https://api.github.com/users/reactioncommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/reactioncommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactioncommerce/subscriptions","organizations_url":"https://api.github.com/users/reactioncommerce/orgs","repos_url":"https://api.github.com/users/reactioncommerce/repos","events_url":"https://api.github.com/users/reactioncommerce/events{/privacy}","received_events_url":"https://api.github.com/users/reactioncommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":12926963,"name":"reaction","full_name":"reactioncommerce/reaction","owner":{"login":"reactioncommerce","id":5605462,"avatar_url":"https://avatars0.githubusercontent.com/u/5605462?v=4","gravatar_id":"","url":"https://api.github.com/users/reactioncommerce","html_url":"https://github.com/reactioncommerce","followers_url":"https://api.github.com/users/reactioncommerce/followers","following_url":"https://api.github.com/users/reactioncommerce/following{/other_user}","gists_url":"https://api.github.com/users/reactioncommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/reactioncommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactioncommerce/subscriptions","organizations_url":"https://api.github.com/users/reactioncommerce/orgs","repos_url":"https://api.github.com/users/reactioncommerce/repos","events_url":"https://api.github.com/users/reactioncommerce/events{/privacy}","received_events_url":"https://api.github.com/users/reactioncommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reactioncommerce/reaction","description":"Reaction is a customizable, real-time reactive, JavaScript commerce platform.","fork":false,"url":"https://api.github.com/repos/reactioncommerce/reaction","forks_url":"https://api.github.com/repos/reactioncommerce/reaction/forks","keys_url":"https://api.github.com/repos/reactioncommerce/reaction/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reactioncommerce/reaction/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reactioncommerce/reaction/teams","hooks_url":"https://api.github.com/repos/reactioncommerce/reaction/hooks","issue_events_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/events{/number}","events_url":"https://api.github.com/repos/reactioncommerce/reaction/events","assignees_url":"https://api.github.com/repos/reactioncommerce/reaction/assignees{/user}","branches_url":"https://api.github.com/repos/reactioncommerce/reaction/branches{/branch}","tags_url":"https://api.github.com/repos/reactioncommerce/reaction/tags","blobs_url":"https://api.github.com/repos/reactioncommerce/reaction/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reactioncommerce/reaction/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reactioncommerce/reaction/git/refs{/sha}","trees_url":"https://api.github.com/repos/reactioncommerce/reaction/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reactioncommerce/reaction/statuses/{sha}","languages_url":"https://api.github.com/repos/reactioncommerce/reaction/languages","stargazers_url":"https://api.github.com/repos/reactioncommerce/reaction/stargazers","contributors_url":"https://api.github.com/repos/reactioncommerce/reaction/contributors","subscribers_url":"https://api.github.com/repos/reactioncommerce/reaction/subscribers","subscription_url":"https://api.github.com/repos/reactioncommerce/reaction/subscription","commits_url":"https://api.github.com/repos/reactioncommerce/reaction/commits{/sha}","git_commits_url":"https://api.github.com/repos/reactioncommerce/reaction/git/commits{/sha}","comments_url":"https://api.github.com/repos/reactioncommerce/reaction/comments{/number}","issue_comment_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/comments{/number}","contents_url":"https://api.github.com/repos/reactioncommerce/reaction/contents/{+path}","compare_url":"https://api.github.com/repos/reactioncommerce/reaction/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reactioncommerce/reaction/merges","archive_url":"https://api.github.com/repos/reactioncommerce/reaction/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reactioncommerce/reaction/downloads","issues_url":"https://api.github.com/repos/reactioncommerce/reaction/issues{/number}","pulls_url":"https://api.github.com/repos/reactioncommerce/reaction/pulls{/number}","milestones_url":"https://api.github.com/repos/reactioncommerce/reaction/milestones{/number}","notifications_url":"https://api.github.com/repos/reactioncommerce/reaction/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reactioncommerce/reaction/labels{/name}","releases_url":"https://api.github.com/repos/reactioncommerce/reaction/releases{/id}","deployments_url":"https://api.github.com/repos/reactioncommerce/reaction/deployments","created_at":"2013-09-18T15:30:36Z","updated_at":"2018-03-13T20:29:18Z","pushed_at":"2018-03-13T21:39:38Z","git_url":"git://github.com/reactioncommerce/reaction.git","ssh_url":"git@github.com:reactioncommerce/reaction.git","clone_url":"https://github.com/reactioncommerce/reaction.git","svn_url":"https://github.com/reactioncommerce/reaction","homepage":"https://reactioncommerce.com/","size":43720,"stargazers_count":6708,"watchers_count":6708,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1289,"mirror_url":null,"archived":false,"open_issues_count":350,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1289,"open_issues":350,"watchers":6708,"default_branch":"master"}},"base":{"label":"reactioncommerce:tests-3936-aldeed-graphql-jest","ref":"tests-3936-aldeed-graphql-jest","sha":"f204c009133ba7c0bfdf6b1e75c86840fe1f7524","user":{"login":"reactioncommerce","id":5605462,"avatar_url":"https://avatars0.githubusercontent.com/u/5605462?v=4","gravatar_id":"","url":"https://api.github.com/users/reactioncommerce","html_url":"https://github.com/reactioncommerce","followers_url":"https://api.github.com/users/reactioncommerce/followers","following_url":"https://api.github.com/users/reactioncommerce/following{/other_user}","gists_url":"https://api.github.com/users/reactioncommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/reactioncommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactioncommerce/subscriptions","organizations_url":"https://api.github.com/users/reactioncommerce/orgs","repos_url":"https://api.github.com/users/reactioncommerce/repos","events_url":"https://api.github.com/users/reactioncommerce/events{/privacy}","received_events_url":"https://api.github.com/users/reactioncommerce/received_events","type":"Organization","site_admin":false},"repo":{"id":12926963,"name":"reaction","full_name":"reactioncommerce/reaction","owner":{"login":"reactioncommerce","id":5605462,"avatar_url":"https://avatars0.githubusercontent.com/u/5605462?v=4","gravatar_id":"","url":"https://api.github.com/users/reactioncommerce","html_url":"https://github.com/reactioncommerce","followers_url":"https://api.github.com/users/reactioncommerce/followers","following_url":"https://api.github.com/users/reactioncommerce/following{/other_user}","gists_url":"https://api.github.com/users/reactioncommerce/gists{/gist_id}","starred_url":"https://api.github.com/users/reactioncommerce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reactioncommerce/subscriptions","organizations_url":"https://api.github.com/users/reactioncommerce/orgs","repos_url":"https://api.github.com/users/reactioncommerce/repos","events_url":"https://api.github.com/users/reactioncommerce/events{/privacy}","received_events_url":"https://api.github.com/users/reactioncommerce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reactioncommerce/reaction","description":"Reaction is a customizable, real-time reactive, JavaScript commerce platform.","fork":false,"url":"https://api.github.com/repos/reactioncommerce/reaction","forks_url":"https://api.github.com/repos/reactioncommerce/reaction/forks","keys_url":"https://api.github.com/repos/reactioncommerce/reaction/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reactioncommerce/reaction/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reactioncommerce/reaction/teams","hooks_url":"https://api.github.com/repos/reactioncommerce/reaction/hooks","issue_events_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/events{/number}","events_url":"https://api.github.com/repos/reactioncommerce/reaction/events","assignees_url":"https://api.github.com/repos/reactioncommerce/reaction/assignees{/user}","branches_url":"https://api.github.com/repos/reactioncommerce/reaction/branches{/branch}","tags_url":"https://api.github.com/repos/reactioncommerce/reaction/tags","blobs_url":"https://api.github.com/repos/reactioncommerce/reaction/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reactioncommerce/reaction/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reactioncommerce/reaction/git/refs{/sha}","trees_url":"https://api.github.com/repos/reactioncommerce/reaction/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reactioncommerce/reaction/statuses/{sha}","languages_url":"https://api.github.com/repos/reactioncommerce/reaction/languages","stargazers_url":"https://api.github.com/repos/reactioncommerce/reaction/stargazers","contributors_url":"https://api.github.com/repos/reactioncommerce/reaction/contributors","subscribers_url":"https://api.github.com/repos/reactioncommerce/reaction/subscribers","subscription_url":"https://api.github.com/repos/reactioncommerce/reaction/subscription","commits_url":"https://api.github.com/repos/reactioncommerce/reaction/commits{/sha}","git_commits_url":"https://api.github.com/repos/reactioncommerce/reaction/git/commits{/sha}","comments_url":"https://api.github.com/repos/reactioncommerce/reaction/comments{/number}","issue_comment_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/comments{/number}","contents_url":"https://api.github.com/repos/reactioncommerce/reaction/contents/{+path}","compare_url":"https://api.github.com/repos/reactioncommerce/reaction/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reactioncommerce/reaction/merges","archive_url":"https://api.github.com/repos/reactioncommerce/reaction/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reactioncommerce/reaction/downloads","issues_url":"https://api.github.com/repos/reactioncommerce/reaction/issues{/number}","pulls_url":"https://api.github.com/repos/reactioncommerce/reaction/pulls{/number}","milestones_url":"https://api.github.com/repos/reactioncommerce/reaction/milestones{/number}","notifications_url":"https://api.github.com/repos/reactioncommerce/reaction/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reactioncommerce/reaction/labels{/name}","releases_url":"https://api.github.com/repos/reactioncommerce/reaction/releases{/id}","deployments_url":"https://api.github.com/repos/reactioncommerce/reaction/deployments","created_at":"2013-09-18T15:30:36Z","updated_at":"2018-03-13T20:29:18Z","pushed_at":"2018-03-13T21:39:38Z","git_url":"git://github.com/reactioncommerce/reaction.git","ssh_url":"git@github.com:reactioncommerce/reaction.git","clone_url":"https://github.com/reactioncommerce/reaction.git","svn_url":"https://github.com/reactioncommerce/reaction","homepage":"https://reactioncommerce.com/","size":43720,"stargazers_count":6708,"watchers_count":6708,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1289,"mirror_url":null,"archived":false,"open_issues_count":350,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1289,"open_issues":350,"watchers":6708,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reactioncommerce/reaction/pulls/3991"},"html":{"href":"https://github.com/reactioncommerce/reaction/pull/3991"},"issue":{"href":"https://api.github.com/repos/reactioncommerce/reaction/issues/3991"},"comments":{"href":"https://api.github.com/repos/reactioncommerce/reaction/issues/3991/comments"},"review_comments":{"href":"https://api.github.com/repos/reactioncommerce/reaction/pulls/3991/comments"},"review_comment":{"href":"https://api.github.com/repos/reactioncommerce/reaction/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/reactioncommerce/reaction/pulls/3991/commits"},"statuses":{"href":"https://api.github.com/repos/reactioncommerce/reaction/statuses/5eba828f98e58bc098308698af511d145d25fd6d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"aldeed"}}