{"action":"created","issue":{"url":"https://api.github.com/repos/graphql/graphql-js/issues/377","repository_url":"https://api.github.com/repos/graphql/graphql-js","labels_url":"https://api.github.com/repos/graphql/graphql-js/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/graphql/graphql-js/issues/377/comments","events_url":"https://api.github.com/repos/graphql/graphql-js/issues/377/events","html_url":"https://github.com/graphql/graphql-js/pull/377","id":153268423,"number":377,"title":"Revert \"Remove all 'instanceof GraphQLSchema' checks\"","user":{"login":"leebyron","id":50130,"avatar_url":"https://avatars.githubusercontent.com/u/50130?v=3","gravatar_id":"","url":"https://api.github.com/users/leebyron","html_url":"https://github.com/leebyron","followers_url":"https://api.github.com/users/leebyron/followers","following_url":"https://api.github.com/users/leebyron/following{/other_user}","gists_url":"https://api.github.com/users/leebyron/gists{/gist_id}","starred_url":"https://api.github.com/users/leebyron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leebyron/subscriptions","organizations_url":"https://api.github.com/users/leebyron/orgs","repos_url":"https://api.github.com/users/leebyron/repos","events_url":"https://api.github.com/users/leebyron/events{/privacy}","received_events_url":"https://api.github.com/users/leebyron/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-05T16:23:42Z","updated_at":"2016-05-05T20:33:34Z","closed_at":"2016-05-05T16:23:48Z","pull_request":{"url":"https://api.github.com/repos/graphql/graphql-js/pulls/377","html_url":"https://github.com/graphql/graphql-js/pull/377","diff_url":"https://github.com/graphql/graphql-js/pull/377.diff","patch_url":"https://github.com/graphql/graphql-js/pull/377.patch"},"body":"Reverts graphql/graphql-js#371\r\n\r\nNow have a better understanding of why those invariants were there - because `instanceof` is used in many other places, removing these doesn't allow the use of GraphQLSchema defined by other versions of graphql-js because eventually checks like `instanceof GraphQLList` or `instanceof GraphQLObjectType` will fail for the same reasons - but at that point the produced errors may be far more mysterious. These invariants were added to at least give a clear error message early on.\r\n\r\nIf we want to enable this, we'll have to completely remove `instanceof`."},"comment":{"url":"https://api.github.com/repos/graphql/graphql-js/issues/comments/217269944","html_url":"https://github.com/graphql/graphql-js/pull/377#issuecomment-217269944","issue_url":"https://api.github.com/repos/graphql/graphql-js/issues/377","id":217269944,"user":{"login":"sheerun","id":292365,"avatar_url":"https://avatars.githubusercontent.com/u/292365?v=3","gravatar_id":"","url":"https://api.github.com/users/sheerun","html_url":"https://github.com/sheerun","followers_url":"https://api.github.com/users/sheerun/followers","following_url":"https://api.github.com/users/sheerun/following{/other_user}","gists_url":"https://api.github.com/users/sheerun/gists{/gist_id}","starred_url":"https://api.github.com/users/sheerun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheerun/subscriptions","organizations_url":"https://api.github.com/users/sheerun/orgs","repos_url":"https://api.github.com/users/sheerun/repos","events_url":"https://api.github.com/users/sheerun/events{/privacy}","received_events_url":"https://api.github.com/users/sheerun/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T20:33:34Z","updated_at":"2016-05-05T20:33:34Z","body":"What about:\r\n\r\n1. Creating interfaces for each type like `GraphQLSchemaInterface` \r\n2. Making actual classes like `GraphQLSchema` to inherit from interfaces \r\n3. Replacing `instanceof` checks to interfaces instead of actual classes\r\n4. Requiring external modules to inherit from interfaces"}}