{"action":"created","issue":{"url":"https://api.github.com/repos/nuwave/lighthouse/issues/319","repository_url":"https://api.github.com/repos/nuwave/lighthouse","labels_url":"https://api.github.com/repos/nuwave/lighthouse/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/nuwave/lighthouse/issues/319/comments","events_url":"https://api.github.com/repos/nuwave/lighthouse/issues/319/events","html_url":"https://github.com/nuwave/lighthouse/issues/319","id":360554482,"node_id":"MDU6SXNzdWUzNjA1NTQ0ODI=","number":319,"title":"hasMany directive is ignoring Anonymous Global Scopes on model","user":{"login":"trasteroandy","id":12040887,"node_id":"MDQ6VXNlcjEyMDQwODg3","avatar_url":"https://avatars0.githubusercontent.com/u/12040887?v=4","gravatar_id":"","url":"https://api.github.com/users/trasteroandy","html_url":"https://github.com/trasteroandy","followers_url":"https://api.github.com/users/trasteroandy/followers","following_url":"https://api.github.com/users/trasteroandy/following{/other_user}","gists_url":"https://api.github.com/users/trasteroandy/gists{/gist_id}","starred_url":"https://api.github.com/users/trasteroandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trasteroandy/subscriptions","organizations_url":"https://api.github.com/users/trasteroandy/orgs","repos_url":"https://api.github.com/users/trasteroandy/repos","events_url":"https://api.github.com/users/trasteroandy/events{/privacy}","received_events_url":"https://api.github.com/users/trasteroandy/received_events","type":"User","site_admin":false},"labels":[{"id":384418443,"node_id":"MDU6TGFiZWwzODQ0MTg0NDM=","url":"https://api.github.com/repos/nuwave/lighthouse/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-15T16:26:37Z","updated_at":"2018-09-15T23:51:46Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI have this line in a graphql type:\r\n\r\n```\r\ncuentas: [Cuenta]! @hasMany\r\n```\r\n\r\nand the Laravel Model \"Cuenta\" has declared an [Anonymous Global Scope](https://laravel.com/docs/5.7/eloquent#query-scopes):\r\n\r\n```\r\nclass Cuenta extends Model\r\n{\r\n    protected static function boot()\r\n    {\r\n        parent::boot();\r\n        static::addGlobalScope('habilitado', function (Builder $builder) {\r\n            $builder->where('habilitado', '=', true);\r\n        });\r\n    }\r\n```\r\n\r\nIt works fine in normal code in laravel, but when the client (Apollo) calls the graphql server, the response is using some query that **ignores the global scope** \"habilitado\".\r\n\r\n**Expected behavior**\r\n\r\nDon't know if LightHouse use the default relations of the model, but the query that LightHouse uses to retrieve \"cuentas\" should include:\r\n```\r\nwhere habilitado = true\r\n```\r\nand it doesn't.\r\n\r\n**Environment**\r\n\r\nLighthouse Version: 2.1\r\nLaravel Version: 5.6\r\nPHP Version: 7.2\r\n\r\nThanks a lot, best regards\r\n"},"comment":{"url":"https://api.github.com/repos/nuwave/lighthouse/issues/comments/421656179","html_url":"https://github.com/nuwave/lighthouse/issues/319#issuecomment-421656179","issue_url":"https://api.github.com/repos/nuwave/lighthouse/issues/319","id":421656179,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTY1NjE3OQ==","user":{"login":"trasteroandy","id":12040887,"node_id":"MDQ6VXNlcjEyMDQwODg3","avatar_url":"https://avatars0.githubusercontent.com/u/12040887?v=4","gravatar_id":"","url":"https://api.github.com/users/trasteroandy","html_url":"https://github.com/trasteroandy","followers_url":"https://api.github.com/users/trasteroandy/followers","following_url":"https://api.github.com/users/trasteroandy/following{/other_user}","gists_url":"https://api.github.com/users/trasteroandy/gists{/gist_id}","starred_url":"https://api.github.com/users/trasteroandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trasteroandy/subscriptions","organizations_url":"https://api.github.com/users/trasteroandy/orgs","repos_url":"https://api.github.com/users/trasteroandy/repos","events_url":"https://api.github.com/users/trasteroandy/events{/privacy}","received_events_url":"https://api.github.com/users/trasteroandy/received_events","type":"User","site_admin":false},"created_at":"2018-09-15T23:51:46Z","updated_at":"2018-09-15T23:51:46Z","author_association":"NONE","body":"Hi, I have tried that fixed branch, but got the error:\n\nNo directive has been registered for [scalar]\n\nbecouse the file \"lighthouse/src/Schema/Directives/Nodes/*ScalarDirective.*\nphp\" has been removed. I have this code in my schema.graphql definition:\n\nscalar DateTime @scalar(class:\n\"Nuwave\\\\Lighthouse\\\\Schema\\\\Types\\\\Scalars\\\\DateTime\")\n\n\nHow should I proceed?\nthanks in advance\n\n\n\nEl sáb., 15 sept. 2018 a las 19:47, Benedikt Franke (<\nnotifications@github.com>) escribió:\n\n> Can you try my fixed branch\n> https://github.com/mll-lab/lighthouse/tree/native-load-with and see if\n> that does it for you?\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/nuwave/lighthouse/issues/319#issuecomment-421606409>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ALe6t3Y8DvksLcN-e_Oy2xIinNzt4Wd8ks5ubT0kgaJpZM4Wqboc>\n> .\n>\n"}}
{"actor":{"display_login":"trasteroandy"}}