{"action":"created","issue":{"url":"https://api.github.com/repos/graphql-go/graphql/issues/71","labels_url":"https://api.github.com/repos/graphql-go/graphql/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/graphql-go/graphql/issues/71/comments","events_url":"https://api.github.com/repos/graphql-go/graphql/issues/71/events","html_url":"https://github.com/graphql-go/graphql/pull/71","id":115843400,"number":71,"title":"[WIP] Working draft version of `validator` and a couple of `validation rules`","user":{"login":"sogko","id":78585,"avatar_url":"https://avatars.githubusercontent.com/u/78585?v=3","gravatar_id":"","url":"https://api.github.com/users/sogko","html_url":"https://github.com/sogko","followers_url":"https://api.github.com/users/sogko/followers","following_url":"https://api.github.com/users/sogko/following{/other_user}","gists_url":"https://api.github.com/users/sogko/gists{/gist_id}","starred_url":"https://api.github.com/users/sogko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sogko/subscriptions","organizations_url":"https://api.github.com/users/sogko/orgs","repos_url":"https://api.github.com/users/sogko/repos","events_url":"https://api.github.com/users/sogko/events{/privacy}","received_events_url":"https://api.github.com/users/sogko/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/graphql-go/graphql/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"sogko","id":78585,"avatar_url":"https://avatars.githubusercontent.com/u/78585?v=3","gravatar_id":"","url":"https://api.github.com/users/sogko","html_url":"https://github.com/sogko","followers_url":"https://api.github.com/users/sogko/followers","following_url":"https://api.github.com/users/sogko/following{/other_user}","gists_url":"https://api.github.com/users/sogko/gists{/gist_id}","starred_url":"https://api.github.com/users/sogko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sogko/subscriptions","organizations_url":"https://api.github.com/users/sogko/orgs","repos_url":"https://api.github.com/users/sogko/repos","events_url":"https://api.github.com/users/sogko/events{/privacy}","received_events_url":"https://api.github.com/users/sogko/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-11-09T09:59:21Z","updated_at":"2015-11-12T01:45:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/graphql-go/graphql/pulls/71","html_url":"https://github.com/graphql-go/graphql/pull/71","diff_url":"https://github.com/graphql-go/graphql/pull/71.diff","patch_url":"https://github.com/graphql-go/graphql/pull/71.patch"},"body":"Related #67 \r\n\r\n**Status**: not ready for merge until \r\n\r\n- [ ]  all rules have been ported\r\n  - [x] `ArgumentsOfCorrectType.js`\r\n  - [x] `DefaultValuesOfCorrectType.js`\r\n  - [x] `FieldsOnCorrectType.js`\r\n  - [x] `FragmentsOnCompositeTypes.js`\r\n  - [x] `KnownArgumentNames.js`\r\n  - [x] `KnownDirectives.js`\r\n  - [x] `KnownFragmentNames.js`\r\n  - [x] `KnownTypeNames.js`\r\n  - [ ] `LoneAnonymousOperation.js`\r\n  - [ ] `NoFragmentCycles.js`\r\n  - [ ] `NoUndefinedVariables.js`\r\n  - [ ] `NoUnusedFragments.js`\r\n  - [ ] `NoUnusedVariables.js`\r\n  - [ ] `OverlappingFieldsCanBeMerged.js`\r\n  - [ ] `PossibleFragmentSpreads.js`\r\n  - [ ] `ProvidedNonNullArguments.js`\r\n  - [ ] `ScalarLeafs.js`\r\n  - [ ] `UniqueArgumentNames.js`\r\n  - [ ] `UniqueFragmentNames.js`\r\n  - [ ] `UniqueOperationNames.js`\r\n  - [ ] `VariablesAreInputTypes.js`\r\n  - [ ] `VariablesInAllowedPosition.js`\r\n- [ ] all tests have been ported\r\n  - [x] `ArgumentsOfCorrectType.js`\r\n  - [x] `DefaultValuesOfCorrectType.js`\r\n  - [x] `FieldsOnCorrectType.js`\r\n  - [x] `FragmentsOnCompositeTypes.js`\r\n  - [x] `KnownArgumentNames.js`\r\n  - [x] `KnownDirectives.js`\r\n  - [x] `KnownFragmentNames.js`\r\n  - [x] `KnownTypeNames.js`\r\n  - [ ] `LoneAnonymousOperation.js`\r\n  - [ ] `NoFragmentCycles.js`\r\n  - [ ] `NoUndefinedVariables.js`\r\n  - [ ] `NoUnusedFragments.js`\r\n  - [ ] `NoUnusedVariables.js`\r\n  - [ ] `OverlappingFieldsCanBeMerged.js`\r\n  - [ ] `PossibleFragmentSpreads.js`\r\n  - [ ] `ProvidedNonNullArguments.js`\r\n  - [ ] `ScalarLeafs.js`\r\n  - [ ] `UniqueArgumentNames.js`\r\n  - [ ] `UniqueFragmentNames.js`\r\n  - [ ] `UniqueOperationNames.js`\r\n  - [ ] `VariablesAreInputTypes.js`\r\n  - [ ] `VariablesInAllowedPosition.js`\r\n- [ ] maintain or improve coverage\r\n\r\nNotes\r\n- Ported a portion of tests to verify validator is working at some level.\r\n- Updated `visitor` implementation.\r\n  - Proved to be tricky because current implementation allows user to edit the tree in-memory\r\n  - for e.g. `printer` reduces the `ast.Node` into a string\r\n  - Need thorough clean up but working at the moment.\r\n- Rules have to exists under `graphql`, due it being tightly-coupled.\r\n  - Total number of rules: 22\r\n  - Currently planned to write all rules in `rules.go`.\r\n  - Else, split it up to many files\r\n  - But tests are filed under `rules/` folder.\r\n- Should be relatively straight forward to implement rules and its tests since now we have something to work on."},"comment":{"url":"https://api.github.com/repos/graphql-go/graphql/issues/comments/155970621","html_url":"https://github.com/graphql-go/graphql/pull/71#issuecomment-155970621","issue_url":"https://api.github.com/repos/graphql-go/graphql/issues/71","id":155970621,"user":{"login":"chris-ramon","id":1000404,"avatar_url":"https://avatars.githubusercontent.com/u/1000404?v=3","gravatar_id":"","url":"https://api.github.com/users/chris-ramon","html_url":"https://github.com/chris-ramon","followers_url":"https://api.github.com/users/chris-ramon/followers","following_url":"https://api.github.com/users/chris-ramon/following{/other_user}","gists_url":"https://api.github.com/users/chris-ramon/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-ramon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-ramon/subscriptions","organizations_url":"https://api.github.com/users/chris-ramon/orgs","repos_url":"https://api.github.com/users/chris-ramon/repos","events_url":"https://api.github.com/users/chris-ramon/events{/privacy}","received_events_url":"https://api.github.com/users/chris-ramon/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T01:45:33Z","updated_at":"2015-11-12T01:45:33Z","body":"Awesome! :star2:  ... thanks for working on the `validator` @sogko!\r\n\r\nPretty need, I've being trying-out the lib in a small demo project and sometimes my graphql operations are syntactically correct but semantically incorrect, not valid one against my previously defined schema, this is def gonna help this kind of scenarios."}}