{"action":"created","issue":{"url":"https://api.github.com/repos/graphql/graphql-js/issues/264","labels_url":"https://api.github.com/repos/graphql/graphql-js/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/graphql/graphql-js/issues/264/comments","events_url":"https://api.github.com/repos/graphql/graphql-js/issues/264/events","html_url":"https://github.com/graphql/graphql-js/pull/264","id":122040052,"number":264,"title":"Add directives to FieldDefinition","user":{"login":"igorcanadi","id":1091023,"avatar_url":"https://avatars.githubusercontent.com/u/1091023?v=3","gravatar_id":"","url":"https://api.github.com/users/igorcanadi","html_url":"https://github.com/igorcanadi","followers_url":"https://api.github.com/users/igorcanadi/followers","following_url":"https://api.github.com/users/igorcanadi/following{/other_user}","gists_url":"https://api.github.com/users/igorcanadi/gists{/gist_id}","starred_url":"https://api.github.com/users/igorcanadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorcanadi/subscriptions","organizations_url":"https://api.github.com/users/igorcanadi/orgs","repos_url":"https://api.github.com/users/igorcanadi/repos","events_url":"https://api.github.com/users/igorcanadi/events{/privacy}","received_events_url":"https://api.github.com/users/igorcanadi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/graphql/graphql-js/labels/CLA%20Signed","name":"CLA Signed","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-14T13:16:04Z","updated_at":"2015-12-14T18:56:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/graphql/graphql-js/pulls/264","html_url":"https://github.com/graphql/graphql-js/pull/264","diff_url":"https://github.com/graphql/graphql-js/pull/264.diff","patch_url":"https://github.com/graphql/graphql-js/pull/264.patch"},"body":"This pull requests adds a new feature to the language -- directives for fields in type definitions and extensions. For example, now you're able to do this:\r\n\r\n    type Hello {\r\n       world: String @mock(value: \"hello\")\r\n    }\r\n\r\nWe need directives for fields to enable the mock functionality we're building -- we'd like product developers to quickly specify some mock data on top of which they can build UI. That way we decouple building UI and server endpoints.\r\n\r\nWe could add directives to fields in a query, but if the platform is using type models, it's easier to add @mock to fields in a type definition -- the auto-generated type model just needs to override the default field getter."},"comment":{"url":"https://api.github.com/repos/graphql/graphql-js/issues/comments/164525509","html_url":"https://github.com/graphql/graphql-js/pull/264#issuecomment-164525509","issue_url":"https://api.github.com/repos/graphql/graphql-js/issues/264","id":164525509,"user":{"login":"igorcanadi","id":1091023,"avatar_url":"https://avatars.githubusercontent.com/u/1091023?v=3","gravatar_id":"","url":"https://api.github.com/users/igorcanadi","html_url":"https://github.com/igorcanadi","followers_url":"https://api.github.com/users/igorcanadi/followers","following_url":"https://api.github.com/users/igorcanadi/following{/other_user}","gists_url":"https://api.github.com/users/igorcanadi/gists{/gist_id}","starred_url":"https://api.github.com/users/igorcanadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorcanadi/subscriptions","organizations_url":"https://api.github.com/users/igorcanadi/orgs","repos_url":"https://api.github.com/users/igorcanadi/repos","events_url":"https://api.github.com/users/igorcanadi/events{/privacy}","received_events_url":"https://api.github.com/users/igorcanadi/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T18:56:42Z","updated_at":"2015-12-14T18:56:42Z","body":"BTW this PR is just extending the language, AST and visitor. I'm still working on a separate PR that will enable directives in extendSchema(). Let me know if there's anything else I also need to implement."}}