{"action":"created","issue":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1123","repository_url":"https://api.github.com/repos/rmosolgo/graphql-ruby","labels_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1123/labels{/name}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1123/comments","events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1123/events","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/1123","id":276073478,"node_id":"MDU6SXNzdWUyNzYwNzM0Nzg=","number":1123,"title":"`BuildFromDefinition` Issue with overriding scalars.","user":{"login":"xuorig","id":1919498,"node_id":"MDQ6VXNlcjE5MTk0OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/1919498?v=4","gravatar_id":"","url":"https://api.github.com/users/xuorig","html_url":"https://github.com/xuorig","followers_url":"https://api.github.com/users/xuorig/followers","following_url":"https://api.github.com/users/xuorig/following{/other_user}","gists_url":"https://api.github.com/users/xuorig/gists{/gist_id}","starred_url":"https://api.github.com/users/xuorig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuorig/subscriptions","organizations_url":"https://api.github.com/users/xuorig/orgs","repos_url":"https://api.github.com/users/xuorig/repos","events_url":"https://api.github.com/users/xuorig/events{/privacy}","received_events_url":"https://api.github.com/users/xuorig/received_events","type":"User","site_admin":true},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-11-22T13:48:05Z","updated_at":"2019-10-23T15:04:36Z","closed_at":"2019-10-23T15:04:36Z","author_association":"CONTRIBUTOR","body":"Currently it's in theory possible to override scalars and directives when providing an IDL to `BuildFromDefinition`\r\n\r\nHowever, when it comes to scalars, there's weird behaviour happening when only overriding scalars and not directives.\r\n\r\nIf I provide this IDL:\r\n\r\n```\r\nscalar String\r\n```\r\n\r\nWe'll see this error happen:\r\n\r\n`RuntimeError: Duplicate type definition found for name 'String'`\r\n\r\nThis is because our schema uses the Built In directives, and these built in directives use the built in `String` scalar.\r\n\r\nThis causes a weird inconsistency where all other types use our overriden String scalar, and built in directives use `GraphQL::STRING_TYPE`.\r\n\r\n### Solution?\r\n\r\nI'm honestly not sure what the correct solution to this is. At first I thought that maybe we should raise when overriding built ins, but this test https://github.com/xuorig/graphql-ruby/blame/master/spec/graphql/schema/build_from_definition_spec.rb#L97 seems to say that it should be possible.\r\n\r\nIf it should be possible, then we should probably redefine built in directives using the overriden types in these cases.\r\n"},"comment":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/comments/545488402","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/1123#issuecomment-545488402","issue_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1123","id":545488402,"node_id":"MDEyOklzc3VlQ29tbWVudDU0NTQ4ODQwMg==","user":{"login":"rmosolgo","id":2231765,"node_id":"MDQ6VXNlcjIyMzE3NjU=","avatar_url":"https://avatars3.githubusercontent.com/u/2231765?v=4","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":true},"created_at":"2019-10-23T15:04:36Z","updated_at":"2019-10-23T15:04:36Z","author_association":"OWNER","body":"It doesn't seem like this has come up for almost 2 years, so I'm not going to consider it a problem."}}
{"actor":{"display_login":"rmosolgo"}}