{"action":"created","issue":{"url":"https://api.github.com/repos/strapi/strapi/issues/1484","repository_url":"https://api.github.com/repos/strapi/strapi","labels_url":"https://api.github.com/repos/strapi/strapi/issues/1484/labels{/name}","comments_url":"https://api.github.com/repos/strapi/strapi/issues/1484/comments","events_url":"https://api.github.com/repos/strapi/strapi/issues/1484/events","html_url":"https://github.com/strapi/strapi/issues/1484","id":337050634,"node_id":"MDU6SXNzdWUzMzcwNTA2MzQ=","number":1484,"title":"Filtering nested objects returns null in GraphQL","user":{"login":"Blacknosaur","id":37783365,"node_id":"MDQ6VXNlcjM3NzgzMzY1","avatar_url":"https://avatars1.githubusercontent.com/u/37783365?v=4","gravatar_id":"","url":"https://api.github.com/users/Blacknosaur","html_url":"https://github.com/Blacknosaur","followers_url":"https://api.github.com/users/Blacknosaur/followers","following_url":"https://api.github.com/users/Blacknosaur/following{/other_user}","gists_url":"https://api.github.com/users/Blacknosaur/gists{/gist_id}","starred_url":"https://api.github.com/users/Blacknosaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Blacknosaur/subscriptions","organizations_url":"https://api.github.com/users/Blacknosaur/orgs","repos_url":"https://api.github.com/users/Blacknosaur/repos","events_url":"https://api.github.com/users/Blacknosaur/events{/privacy}","received_events_url":"https://api.github.com/users/Blacknosaur/received_events","type":"User","site_admin":false},"labels":[{"id":749108959,"node_id":"MDU6TGFiZWw3NDkxMDg5NTk=","url":"https://api.github.com/repos/strapi/strapi/labels/priority:%20medium","name":"priority: medium","color":"fbc307","default":false},{"id":834949028,"node_id":"MDU6TGFiZWw4MzQ5NDkwMjg=","url":"https://api.github.com/repos/strapi/strapi/labels/status:%20have%20to%20reproduce","name":"status: have to reproduce","color":"077f53","default":false},{"id":749119992,"node_id":"MDU6TGFiZWw3NDkxMTk5OTI=","url":"https://api.github.com/repos/strapi/strapi/labels/status:%20need%20informations","name":"status: need informations","color":"fffde4","default":false},{"id":267208743,"node_id":"MDU6TGFiZWwyNjcyMDg3NDM=","url":"https://api.github.com/repos/strapi/strapi/labels/type:%20bug%20%F0%9F%90%9B","name":"type: bug 🐛","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":{"login":"lauriejim","id":5716596,"node_id":"MDQ6VXNlcjU3MTY1OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/5716596?v=4","gravatar_id":"","url":"https://api.github.com/users/lauriejim","html_url":"https://github.com/lauriejim","followers_url":"https://api.github.com/users/lauriejim/followers","following_url":"https://api.github.com/users/lauriejim/following{/other_user}","gists_url":"https://api.github.com/users/lauriejim/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriejim/subscriptions","organizations_url":"https://api.github.com/users/lauriejim/orgs","repos_url":"https://api.github.com/users/lauriejim/repos","events_url":"https://api.github.com/users/lauriejim/events{/privacy}","received_events_url":"https://api.github.com/users/lauriejim/received_events","type":"User","site_admin":false},"assignees":[{"login":"lauriejim","id":5716596,"node_id":"MDQ6VXNlcjU3MTY1OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/5716596?v=4","gravatar_id":"","url":"https://api.github.com/users/lauriejim","html_url":"https://github.com/lauriejim","followers_url":"https://api.github.com/users/lauriejim/followers","following_url":"https://api.github.com/users/lauriejim/following{/other_user}","gists_url":"https://api.github.com/users/lauriejim/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriejim/subscriptions","organizations_url":"https://api.github.com/users/lauriejim/orgs","repos_url":"https://api.github.com/users/lauriejim/repos","events_url":"https://api.github.com/users/lauriejim/events{/privacy}","received_events_url":"https://api.github.com/users/lauriejim/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-06-29T15:51:46Z","updated_at":"2018-07-03T10:44:15Z","closed_at":null,"author_association":"NONE","body":"<!-- ⚠️ If you do not respect this template your issue will be closed. -->\r\n\r\n<!-- ⚠️ Before writing your issue make sure you are using:-->\r\n<!-- Node 9.x.x -->\r\n<!-- npm 5.x.x -->\r\n<!-- The latest version of Strapi. -->\r\n\r\n**Informations**\r\n- Node: v10.5.0\r\n- npm: v6.1.0\r\n- Strapi: v3.0.0-alpha.12.6\r\n- MongoDB: v3.4.15\r\n- OS: Ubuntu 16.04.4 LTS\r\n\r\n\r\n**What is the current behavior?**\r\nIn a model with one-to-many relationships, if you try to filter the nested object with a \"where\" statement through GraphQL it always returns null\r\n\r\n**Steps to reproduce the problem**\r\n\r\n`{\r\n\tusers{\r\n\t\t_id\r\n\t\tencuestas( where: { valoracion: 5} ) {\r\n\t\t\t_id\r\n\t\t\tvaloracion\r\n\t\t}\r\n\t}\r\n}`\r\n\r\nUser and encuesta have a one-to-many relationship. The query returns always null but if you delete the filter it works.\r\n\r\nError log:\r\n`\r\nTypeError: Cannot convert object to primitive value\r\n    at parseFloat (<anonymous>)\r\n    at isNumeric (/home/ubuntu/project/api/node_modules/strapi-utils/lib/models.js:15:17)\r\n    at _.forEach (/home/ubuntu/project/api/node_modules/strapi-utils/lib/models.js:462:24)\r\n    at /home/ubuntu/project/api/node_modules/lodash/lodash.js:4925:15\r\n    at baseForOwn (/home/ubuntu/project/api/node_modules/lodash/lodash.js:3010:24)\r\n    at /home/ubuntu/project/api/node_modules/lodash/lodash.js:4894:18\r\n    at Function.forEach (/home/ubuntu/project/api/node_modules/lodash/lodash.js:9342:14)\r\n    at Object.convertParams (/home/ubuntu/project/api/node_modules/strapi-utils/lib/models.js:457:7)\r\n    at encuestas (/home/ubuntu/project/api/plugins/graphql/services/GraphQL.js:570:59)\r\n    at resolveFieldValueOrError (/home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:531:18)\r\n    at resolveField (/home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:495:16)\r\n    at /home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:364:18\r\n    at Array.reduce (<anonymous>)\r\n    at executeFields (/home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:361:42)\r\n    at collectAndExecuteSubfields (/home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:772:10)\r\n    at completeObjectValue (/home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:762:10)\r\n    at completeValue (/home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:660:12)\r\n    at completeValueWithLocatedError (/home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:580:21)\r\n    at completeValueCatchingError (/home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:556:21)\r\n    at /home/ubuntu/project/api/plugins/graphql/node_modules/graphql/execution/execute.js:684:25\r\n    at Array.forEach (<anonymous>)\r\n    at forEach (/home/ubuntu/project/api/plugins/graphql/node_modules/iterall/index.js:83:25)\r\n`\r\n\r\nThis query works flawlessly in Strapi 3.0.0-alpha.12.5 but fails in 3.0.0-alpha.12.6\r\n\r\n\r\n**What is the expected behavior?**\r\nIt should return an array with the items which meet the condition or an empty array if none does.\r\n\r\n\r\n**Suggested solutions**\r\nI don't know how to fix it.\r\n\r\n\r\n\r\n<!-- ⚠️ Make sure to browse the opened and closed issues before submitting your issue. -->\r\n"},"comment":{"url":"https://api.github.com/repos/strapi/strapi/issues/comments/402104048","html_url":"https://github.com/strapi/strapi/issues/1484#issuecomment-402104048","issue_url":"https://api.github.com/repos/strapi/strapi/issues/1484","id":402104048,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjEwNDA0OA==","user":{"login":"lauriejim","id":5716596,"node_id":"MDQ6VXNlcjU3MTY1OTY=","avatar_url":"https://avatars3.githubusercontent.com/u/5716596?v=4","gravatar_id":"","url":"https://api.github.com/users/lauriejim","html_url":"https://github.com/lauriejim","followers_url":"https://api.github.com/users/lauriejim/followers","following_url":"https://api.github.com/users/lauriejim/following{/other_user}","gists_url":"https://api.github.com/users/lauriejim/gists{/gist_id}","starred_url":"https://api.github.com/users/lauriejim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauriejim/subscriptions","organizations_url":"https://api.github.com/users/lauriejim/orgs","repos_url":"https://api.github.com/users/lauriejim/repos","events_url":"https://api.github.com/users/lauriejim/events{/privacy}","received_events_url":"https://api.github.com/users/lauriejim/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T10:44:15Z","updated_at":"2018-07-03T10:44:15Z","author_association":"MEMBER","body":"If you want migrate your application you have to follow migration guides https://github.com/strapi/strapi/wiki\r\nI thinks it's why you have your issue.\r\n\r\nIf you create a new project with alpha.12.6 and you make your graphql query I think it will work. Can you confirm that ?"}}
{"actor":{"display_login":"lauriejim"}}