{"action":"closed","issue":{"url":"https://api.github.com/repos/nuwave/lighthouse/issues/507","repository_url":"https://api.github.com/repos/nuwave/lighthouse","labels_url":"https://api.github.com/repos/nuwave/lighthouse/issues/507/labels{/name}","comments_url":"https://api.github.com/repos/nuwave/lighthouse/issues/507/comments","events_url":"https://api.github.com/repos/nuwave/lighthouse/issues/507/events","html_url":"https://github.com/nuwave/lighthouse/issues/507","id":390950865,"node_id":"MDU6SXNzdWUzOTA5NTA4NjU=","number":507,"title":"Argument names in nested mutations conflict with non-relation methods on the model","user":{"login":"sadnub","id":20450757,"node_id":"MDQ6VXNlcjIwNDUwNzU3","avatar_url":"https://avatars3.githubusercontent.com/u/20450757?v=4","gravatar_id":"","url":"https://api.github.com/users/sadnub","html_url":"https://github.com/sadnub","followers_url":"https://api.github.com/users/sadnub/followers","following_url":"https://api.github.com/users/sadnub/following{/other_user}","gists_url":"https://api.github.com/users/sadnub/gists{/gist_id}","starred_url":"https://api.github.com/users/sadnub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sadnub/subscriptions","organizations_url":"https://api.github.com/users/sadnub/orgs","repos_url":"https://api.github.com/users/sadnub/repos","events_url":"https://api.github.com/users/sadnub/events{/privacy}","received_events_url":"https://api.github.com/users/sadnub/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":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2018-12-14T03:25:14Z","updated_at":"2018-12-21T16:50:29Z","closed_at":"2018-12-21T16:50:29Z","author_association":"NONE","body":"**Describe the bug**\r\nI am using the Spatie Permissions package and there is a 'guard' field on the Role class. When I try to return that field with a query, it will run the Model::guard() method.\r\n\r\n**Expected behavior**\r\nReturn guard field from the database\r\n\r\n**Schema**\r\n\r\n```graphql\r\n#types\r\ntype Role{\r\n    id: ID!\r\n    name: String!\r\n    guard: String\r\n}\r\n\r\n#Inputs\r\ninput AddRoleInput {\r\n    name: String! @rules(apply: [\"required\"])\r\n    guard: String\r\n}\r\n\r\ninput EditRoleInput {\r\n    id: ID! @rules(apply: [\"required\"])\r\n    name: String\r\n    guard: String\r\n}\r\n\r\n#Add Queries to Base Query\r\nextend type Query {\r\n    roles: [Role!]! @all\r\n    role(id: ID! @eq): Role! @find\r\n}\r\n\r\n#Add Mutations to Base Mutation\r\nextend type Mutation {\r\n    addRole(input: AddRoleInput!): Role! @create(flatten: true)\r\n    editRole(input: EditRoleInput!): Role! @update(flatten: true)\r\n    #editRoles(\r\n    #    ids: [ID!]! \r\n    #    input: EditUsersInput!): [User!]! @bulk(flatten: true)\r\n    deleteRole(id: ID!): Role! @delete\r\n    deleteRoles(id: [ID!]!): [Role!]! @delete\r\n}\r\n```\r\n\r\n**Output/Logs**\r\n```\r\nTypeError: Too few arguments to function Illuminate/Database/Eloquent/Model::guard(), 0 passed in /var/www/simple-rmm-appeval()'d code on line 1 and exactly 1 expected\r\n```\r\n\r\n**Environment**\r\n\r\nLighthouse Version: 2.6.3\r\nLaravel Version:5.7.16\r\nPHP Version: 7.2.12\r\n\r\n**Additional context**\r\n\r\nThis seems to be the method it is getting caught up on. I'm not sure if there is a way to check if the method exists only on the model child class.\r\n```\r\n    protected static function extractHasManyArgs(Model $model, Collection $args): Collection\r\n    {\r\n        return $args->partition(function ($value, $key) use ($model) {\r\n            return method_exists($model, $key) && ($model->{$key}() instanceof HasMany);\r\n        });\r\n    }\r\n```\r\n"}}
{"actor":{"display_login":"chrissm79"}}