{"action":"created","issue":{"url":"https://api.github.com/repos/RomainLanz/adonis-graphql/issues/8","repository_url":"https://api.github.com/repos/RomainLanz/adonis-graphql","labels_url":"https://api.github.com/repos/RomainLanz/adonis-graphql/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/RomainLanz/adonis-graphql/issues/8/comments","events_url":"https://api.github.com/repos/RomainLanz/adonis-graphql/issues/8/events","html_url":"https://github.com/RomainLanz/adonis-graphql/issues/8","id":335137694,"node_id":"MDU6SXNzdWUzMzUxMzc2OTQ=","number":8,"title":"Creating own graphql directive ","user":{"login":"yariksav","id":2553313,"node_id":"MDQ6VXNlcjI1NTMzMTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2553313?v=4","gravatar_id":"","url":"https://api.github.com/users/yariksav","html_url":"https://github.com/yariksav","followers_url":"https://api.github.com/users/yariksav/followers","following_url":"https://api.github.com/users/yariksav/following{/other_user}","gists_url":"https://api.github.com/users/yariksav/gists{/gist_id}","starred_url":"https://api.github.com/users/yariksav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yariksav/subscriptions","organizations_url":"https://api.github.com/users/yariksav/orgs","repos_url":"https://api.github.com/users/yariksav/repos","events_url":"https://api.github.com/users/yariksav/events{/privacy}","received_events_url":"https://api.github.com/users/yariksav/received_events","type":"User","site_admin":false},"labels":[{"id":806923448,"node_id":"MDU6TGFiZWw4MDY5MjM0NDg=","url":"https://api.github.com/repos/RomainLanz/adonis-graphql/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":{"login":"RomainLanz","id":2793951,"node_id":"MDQ6VXNlcjI3OTM5NTE=","avatar_url":"https://avatars3.githubusercontent.com/u/2793951?v=4","gravatar_id":"","url":"https://api.github.com/users/RomainLanz","html_url":"https://github.com/RomainLanz","followers_url":"https://api.github.com/users/RomainLanz/followers","following_url":"https://api.github.com/users/RomainLanz/following{/other_user}","gists_url":"https://api.github.com/users/RomainLanz/gists{/gist_id}","starred_url":"https://api.github.com/users/RomainLanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomainLanz/subscriptions","organizations_url":"https://api.github.com/users/RomainLanz/orgs","repos_url":"https://api.github.com/users/RomainLanz/repos","events_url":"https://api.github.com/users/RomainLanz/events{/privacy}","received_events_url":"https://api.github.com/users/RomainLanz/received_events","type":"User","site_admin":false},"assignees":[{"login":"RomainLanz","id":2793951,"node_id":"MDQ6VXNlcjI3OTM5NTE=","avatar_url":"https://avatars3.githubusercontent.com/u/2793951?v=4","gravatar_id":"","url":"https://api.github.com/users/RomainLanz","html_url":"https://github.com/RomainLanz","followers_url":"https://api.github.com/users/RomainLanz/followers","following_url":"https://api.github.com/users/RomainLanz/following{/other_user}","gists_url":"https://api.github.com/users/RomainLanz/gists{/gist_id}","starred_url":"https://api.github.com/users/RomainLanz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomainLanz/subscriptions","organizations_url":"https://api.github.com/users/RomainLanz/orgs","repos_url":"https://api.github.com/users/RomainLanz/repos","events_url":"https://api.github.com/users/RomainLanz/events{/privacy}","received_events_url":"https://api.github.com/users/RomainLanz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-06-23T23:16:13Z","updated_at":"2018-10-26T12:36:48Z","closed_at":"2018-07-28T14:37:07Z","author_association":"NONE","body":"I would want to make own graphql directive for automatically authenticate user in resolvers etc\r\nSomething like middleware in adonis\r\n\r\nexample\r\n```\r\ndirective @isAuthenticated on QUERY | FIELD\r\ndirective @hasScope (scope: [String]) on QUERY | FIELD\r\n\r\ntype Query {\r\n  articles: String @isAuthenticated\r\n}\r\n\r\n```\r\nFor this directives I must create resolver function and put it to specific param **directiveResolvers** in function **makeExecutableSchema**\r\n[docs here](https://www.apollographql.com/docs/graphql-tools/schema-directives.html)\r\n\r\nAs describes in [this docs](https://www.apollographql.com/docs/graphql-tools/generate-schema.html#makeExecutableSchema) makeExecutableSchema method has params \r\n\r\n```\r\n  typeDefs,\r\n  resolvers, // optional\r\n  logger, // optional\r\n  allowUndefinedInResolve = false, // optional\r\n  resolverValidationOptions = {}, // optional\r\n  directiveResolvers = null, // optional\r\n  schemaDirectives = null,  // optional\r\n  parseOptions = {},  // optional\r\n  inheritResolversFromInterfaces = false  // optio\r\n```\r\nbut i's not possible in current implementation 😢 \r\nhttps://github.com/RomainLanz/adonis-graphql/blob/0604f5ee23fd07de9ed87a1ae8b792405e4efe49/src/Server/index.js#L19\r\n\r\nThank YOU! "},"comment":{"url":"https://api.github.com/repos/RomainLanz/adonis-graphql/issues/comments/433393046","html_url":"https://github.com/RomainLanz/adonis-graphql/issues/8#issuecomment-433393046","issue_url":"https://api.github.com/repos/RomainLanz/adonis-graphql/issues/8","id":433393046,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzM5MzA0Ng==","user":{"login":"yariksav","id":2553313,"node_id":"MDQ6VXNlcjI1NTMzMTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2553313?v=4","gravatar_id":"","url":"https://api.github.com/users/yariksav","html_url":"https://github.com/yariksav","followers_url":"https://api.github.com/users/yariksav/followers","following_url":"https://api.github.com/users/yariksav/following{/other_user}","gists_url":"https://api.github.com/users/yariksav/gists{/gist_id}","starred_url":"https://api.github.com/users/yariksav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yariksav/subscriptions","organizations_url":"https://api.github.com/users/yariksav/orgs","repos_url":"https://api.github.com/users/yariksav/repos","events_url":"https://api.github.com/users/yariksav/events{/privacy}","received_events_url":"https://api.github.com/users/yariksav/received_events","type":"User","site_admin":false},"created_at":"2018-10-26T12:36:48Z","updated_at":"2018-10-26T12:36:48Z","author_association":"NONE","body":"Hi! How are things going with the 'directives' feature? "}}
{"actor":{"display_login":"yariksav"}}