{"action":"created","comment":{"url":"https://api.github.com/repos/graphcool/prisma/pulls/comments/175951045","pull_request_review_id":105569485,"id":175951045,"diff_hunk":"@@ -80,29 +84,11 @@ class BulkImport(project: Project)(implicit apiDependencies: ApiDependencies) {\n     string.replace(\"T\", \" \").replace(\"Z\", \" \")\n   }\n \n-  private def generateImportNodesDBActions(nodes: Vector[ImportNode]): Vector[CreateDataItem Or Exception] = {\n-    nodes.map { element =>\n-      val id    = element.identifier.id\n-      val model = project.schema.getModelByName_!(element.identifier.typeName)\n-\n-      val elementReferenceToNonExistentField = element.values.keys.find(key => model.getFieldByName(key).isEmpty)\n-\n-      elementReferenceToNonExistentField match {\n-        case Some(key) =>\n-          Bad(new Exception(s\"Unknown field '$key' in field list\"))\n-\n-        case None =>\n-          val formattedValues = element.values.collect {\n-            case (k, v) if k == \"createdAt\" || k == \"updatedAt\"                                => (k, dateTimeFromISO8601(v))\n-            case (k, v) if model.getFieldByName_!(k).typeIdentifier == TypeIdentifier.DateTime => (k, dateTimeFromISO8601(v))\n-            case (k, v) if model.getFieldByName_!(k).typeIdentifier == TypeIdentifier.Json     => (k, v.toJson)\n-            case (k, v)                                                                        => (k, v)\n-          }\n-          val values = CoolArgs(formattedValues + (\"id\" -> id))\n-          val path   = Path.empty(NodeSelector.forId(model, id))\n-          Good(CreateDataItem(project, path, values))\n-      }\n-    }\n+  private def generateImportNodesDBActions(nodes: Vector[ImportNode]): CreateDataItemsImport = {\n+    require(nodes.nonEmpty)\n+    val args = nodes.map(node => ReallyCoolArgs(node.values))","path":"server/servers/api/src/main/scala/com/prisma/api/import_export/BulkImport.scala","position":71,"original_position":71,"commit_id":"eecbaca73de9025ac972bac480ec74878afa88c9","original_commit_id":"eecbaca73de9025ac972bac480ec74878afa88c9","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Usage of head on collections.](https://app.codacy.com/app/graphcool/prisma/pullRequest?prid=1454803)","created_at":"2018-03-20T23:12:41Z","updated_at":"2018-03-20T23:12:41Z","html_url":"https://github.com/graphcool/prisma/pull/2120#discussion_r175951045","pull_request_url":"https://api.github.com/repos/graphcool/prisma/pulls/2120","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/graphcool/prisma/pulls/comments/175951045"},"html":{"href":"https://github.com/graphcool/prisma/pull/2120#discussion_r175951045"},"pull_request":{"href":"https://api.github.com/repos/graphcool/prisma/pulls/2120"}}},"pull_request":{"url":"https://api.github.com/repos/graphcool/prisma/pulls/2120","id":176195069,"html_url":"https://github.com/graphcool/prisma/pull/2120","diff_url":"https://github.com/graphcool/prisma/pull/2120.diff","patch_url":"https://github.com/graphcool/prisma/pull/2120.patch","issue_url":"https://api.github.com/repos/graphcool/prisma/issues/2120","number":2120,"state":"open","locked":false,"title":"[WIP] Use gcvalues in import","user":{"login":"mavilein","id":2470881,"avatar_url":"https://avatars3.githubusercontent.com/u/2470881?v=4","gravatar_id":"","url":"https://api.github.com/users/mavilein","html_url":"https://github.com/mavilein","followers_url":"https://api.github.com/users/mavilein/followers","following_url":"https://api.github.com/users/mavilein/following{/other_user}","gists_url":"https://api.github.com/users/mavilein/gists{/gist_id}","starred_url":"https://api.github.com/users/mavilein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavilein/subscriptions","organizations_url":"https://api.github.com/users/mavilein/orgs","repos_url":"https://api.github.com/users/mavilein/repos","events_url":"https://api.github.com/users/mavilein/events{/privacy}","received_events_url":"https://api.github.com/users/mavilein/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-20T13:45:49Z","updated_at":"2018-03-20T23:12:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b57e3c567512d1b7e1d434c441b493c786169a2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/graphcool/prisma/pulls/2120/commits","review_comments_url":"https://api.github.com/repos/graphcool/prisma/pulls/2120/comments","review_comment_url":"https://api.github.com/repos/graphcool/prisma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphcool/prisma/issues/2120/comments","statuses_url":"https://api.github.com/repos/graphcool/prisma/statuses/eecbaca73de9025ac972bac480ec74878afa88c9","head":{"label":"graphcool:use-gcvalues-in-import","ref":"use-gcvalues-in-import","sha":"eecbaca73de9025ac972bac480ec74878afa88c9","user":{"login":"graphcool","id":17219288,"avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/graphcool","html_url":"https://github.com/graphcool","followers_url":"https://api.github.com/users/graphcool/followers","following_url":"https://api.github.com/users/graphcool/following{/other_user}","gists_url":"https://api.github.com/users/graphcool/gists{/gist_id}","starred_url":"https://api.github.com/users/graphcool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphcool/subscriptions","organizations_url":"https://api.github.com/users/graphcool/orgs","repos_url":"https://api.github.com/users/graphcool/repos","events_url":"https://api.github.com/users/graphcool/events{/privacy}","received_events_url":"https://api.github.com/users/graphcool/received_events","type":"Organization","site_admin":false},"repo":{"id":69164196,"name":"prisma","full_name":"graphcool/prisma","owner":{"login":"graphcool","id":17219288,"avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/graphcool","html_url":"https://github.com/graphcool","followers_url":"https://api.github.com/users/graphcool/followers","following_url":"https://api.github.com/users/graphcool/following{/other_user}","gists_url":"https://api.github.com/users/graphcool/gists{/gist_id}","starred_url":"https://api.github.com/users/graphcool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphcool/subscriptions","organizations_url":"https://api.github.com/users/graphcool/orgs","repos_url":"https://api.github.com/users/graphcool/repos","events_url":"https://api.github.com/users/graphcool/events{/privacy}","received_events_url":"https://api.github.com/users/graphcool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphcool/prisma","description":"⚡️ Prisma turns your database into a realtime GraphQL API","fork":false,"url":"https://api.github.com/repos/graphcool/prisma","forks_url":"https://api.github.com/repos/graphcool/prisma/forks","keys_url":"https://api.github.com/repos/graphcool/prisma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphcool/prisma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphcool/prisma/teams","hooks_url":"https://api.github.com/repos/graphcool/prisma/hooks","issue_events_url":"https://api.github.com/repos/graphcool/prisma/issues/events{/number}","events_url":"https://api.github.com/repos/graphcool/prisma/events","assignees_url":"https://api.github.com/repos/graphcool/prisma/assignees{/user}","branches_url":"https://api.github.com/repos/graphcool/prisma/branches{/branch}","tags_url":"https://api.github.com/repos/graphcool/prisma/tags","blobs_url":"https://api.github.com/repos/graphcool/prisma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphcool/prisma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphcool/prisma/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphcool/prisma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphcool/prisma/statuses/{sha}","languages_url":"https://api.github.com/repos/graphcool/prisma/languages","stargazers_url":"https://api.github.com/repos/graphcool/prisma/stargazers","contributors_url":"https://api.github.com/repos/graphcool/prisma/contributors","subscribers_url":"https://api.github.com/repos/graphcool/prisma/subscribers","subscription_url":"https://api.github.com/repos/graphcool/prisma/subscription","commits_url":"https://api.github.com/repos/graphcool/prisma/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphcool/prisma/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphcool/prisma/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphcool/prisma/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphcool/prisma/contents/{+path}","compare_url":"https://api.github.com/repos/graphcool/prisma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphcool/prisma/merges","archive_url":"https://api.github.com/repos/graphcool/prisma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphcool/prisma/downloads","issues_url":"https://api.github.com/repos/graphcool/prisma/issues{/number}","pulls_url":"https://api.github.com/repos/graphcool/prisma/pulls{/number}","milestones_url":"https://api.github.com/repos/graphcool/prisma/milestones{/number}","notifications_url":"https://api.github.com/repos/graphcool/prisma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphcool/prisma/labels{/name}","releases_url":"https://api.github.com/repos/graphcool/prisma/releases{/id}","deployments_url":"https://api.github.com/repos/graphcool/prisma/deployments","created_at":"2016-09-25T12:54:40Z","updated_at":"2018-03-20T22:56:12Z","pushed_at":"2018-03-20T20:28:39Z","git_url":"git://github.com/graphcool/prisma.git","ssh_url":"git@github.com:graphcool/prisma.git","clone_url":"https://github.com/graphcool/prisma.git","svn_url":"https://github.com/graphcool/prisma","homepage":"https://www.prismagraphql.com","size":14044,"stargazers_count":6611,"watchers_count":6611,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":368,"mirror_url":null,"archived":false,"open_issues_count":361,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":368,"open_issues":361,"watchers":6611,"default_branch":"master"}},"base":{"label":"graphcool:master","ref":"master","sha":"c1434e1486e55f1dc2a6d21eb97e9c26fb8084d9","user":{"login":"graphcool","id":17219288,"avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/graphcool","html_url":"https://github.com/graphcool","followers_url":"https://api.github.com/users/graphcool/followers","following_url":"https://api.github.com/users/graphcool/following{/other_user}","gists_url":"https://api.github.com/users/graphcool/gists{/gist_id}","starred_url":"https://api.github.com/users/graphcool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphcool/subscriptions","organizations_url":"https://api.github.com/users/graphcool/orgs","repos_url":"https://api.github.com/users/graphcool/repos","events_url":"https://api.github.com/users/graphcool/events{/privacy}","received_events_url":"https://api.github.com/users/graphcool/received_events","type":"Organization","site_admin":false},"repo":{"id":69164196,"name":"prisma","full_name":"graphcool/prisma","owner":{"login":"graphcool","id":17219288,"avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/graphcool","html_url":"https://github.com/graphcool","followers_url":"https://api.github.com/users/graphcool/followers","following_url":"https://api.github.com/users/graphcool/following{/other_user}","gists_url":"https://api.github.com/users/graphcool/gists{/gist_id}","starred_url":"https://api.github.com/users/graphcool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphcool/subscriptions","organizations_url":"https://api.github.com/users/graphcool/orgs","repos_url":"https://api.github.com/users/graphcool/repos","events_url":"https://api.github.com/users/graphcool/events{/privacy}","received_events_url":"https://api.github.com/users/graphcool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphcool/prisma","description":"⚡️ Prisma turns your database into a realtime GraphQL API","fork":false,"url":"https://api.github.com/repos/graphcool/prisma","forks_url":"https://api.github.com/repos/graphcool/prisma/forks","keys_url":"https://api.github.com/repos/graphcool/prisma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphcool/prisma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphcool/prisma/teams","hooks_url":"https://api.github.com/repos/graphcool/prisma/hooks","issue_events_url":"https://api.github.com/repos/graphcool/prisma/issues/events{/number}","events_url":"https://api.github.com/repos/graphcool/prisma/events","assignees_url":"https://api.github.com/repos/graphcool/prisma/assignees{/user}","branches_url":"https://api.github.com/repos/graphcool/prisma/branches{/branch}","tags_url":"https://api.github.com/repos/graphcool/prisma/tags","blobs_url":"https://api.github.com/repos/graphcool/prisma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphcool/prisma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphcool/prisma/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphcool/prisma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphcool/prisma/statuses/{sha}","languages_url":"https://api.github.com/repos/graphcool/prisma/languages","stargazers_url":"https://api.github.com/repos/graphcool/prisma/stargazers","contributors_url":"https://api.github.com/repos/graphcool/prisma/contributors","subscribers_url":"https://api.github.com/repos/graphcool/prisma/subscribers","subscription_url":"https://api.github.com/repos/graphcool/prisma/subscription","commits_url":"https://api.github.com/repos/graphcool/prisma/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphcool/prisma/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphcool/prisma/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphcool/prisma/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphcool/prisma/contents/{+path}","compare_url":"https://api.github.com/repos/graphcool/prisma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphcool/prisma/merges","archive_url":"https://api.github.com/repos/graphcool/prisma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphcool/prisma/downloads","issues_url":"https://api.github.com/repos/graphcool/prisma/issues{/number}","pulls_url":"https://api.github.com/repos/graphcool/prisma/pulls{/number}","milestones_url":"https://api.github.com/repos/graphcool/prisma/milestones{/number}","notifications_url":"https://api.github.com/repos/graphcool/prisma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphcool/prisma/labels{/name}","releases_url":"https://api.github.com/repos/graphcool/prisma/releases{/id}","deployments_url":"https://api.github.com/repos/graphcool/prisma/deployments","created_at":"2016-09-25T12:54:40Z","updated_at":"2018-03-20T22:56:12Z","pushed_at":"2018-03-20T20:28:39Z","git_url":"git://github.com/graphcool/prisma.git","ssh_url":"git@github.com:graphcool/prisma.git","clone_url":"https://github.com/graphcool/prisma.git","svn_url":"https://github.com/graphcool/prisma","homepage":"https://www.prismagraphql.com","size":14044,"stargazers_count":6611,"watchers_count":6611,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":368,"mirror_url":null,"archived":false,"open_issues_count":361,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":368,"open_issues":361,"watchers":6611,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphcool/prisma/pulls/2120"},"html":{"href":"https://github.com/graphcool/prisma/pull/2120"},"issue":{"href":"https://api.github.com/repos/graphcool/prisma/issues/2120"},"comments":{"href":"https://api.github.com/repos/graphcool/prisma/issues/2120/comments"},"review_comments":{"href":"https://api.github.com/repos/graphcool/prisma/pulls/2120/comments"},"review_comment":{"href":"https://api.github.com/repos/graphcool/prisma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphcool/prisma/pulls/2120/commits"},"statuses":{"href":"https://api.github.com/repos/graphcool/prisma/statuses/eecbaca73de9025ac972bac480ec74878afa88c9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codacy-bot"}}