{"action":"created","issue":{"url":"https://api.github.com/repos/graphql/graphiql/issues/146","repository_url":"https://api.github.com/repos/graphql/graphiql","labels_url":"https://api.github.com/repos/graphql/graphiql/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/graphql/graphiql/issues/146/comments","events_url":"https://api.github.com/repos/graphql/graphiql/issues/146/events","html_url":"https://github.com/graphql/graphiql/pull/146","id":160344928,"number":146,"title":"Don't assume server is mounted at `/graphql`","user":{"login":"joshprice","id":9307,"avatar_url":"https://avatars.githubusercontent.com/u/9307?v=3","gravatar_id":"","url":"https://api.github.com/users/joshprice","html_url":"https://github.com/joshprice","followers_url":"https://api.github.com/users/joshprice/followers","following_url":"https://api.github.com/users/joshprice/following{/other_user}","gists_url":"https://api.github.com/users/joshprice/gists{/gist_id}","starred_url":"https://api.github.com/users/joshprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshprice/subscriptions","organizations_url":"https://api.github.com/users/joshprice/orgs","repos_url":"https://api.github.com/users/joshprice/repos","events_url":"https://api.github.com/users/joshprice/events{/privacy}","received_events_url":"https://api.github.com/users/joshprice/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/graphql/graphiql/labels/CLA%20Signed","name":"CLA Signed","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-06-15T06:05:28Z","updated_at":"2016-06-23T18:02:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/graphql/graphiql/pulls/146","html_url":"https://github.com/graphql/graphiql/pull/146","diff_url":"https://github.com/graphql/graphiql/pull/146.diff","patch_url":"https://github.com/graphql/graphiql/pull/146.patch"},"body":"The GraphQL server happens to be mounted at `graphql` in this case (https://github.com/graphql/graphiql/blob/master/example/server.js#L28), but we shouldn't assume that.\r\n\r\nThis fix should allow the GraphQL server to be mounted anywhere.\r\n\r\nThe reason this is important is that we use this template in [GraphQL Elixir](https://github.com/graphql-elixir/graphql) (other implementations would likely do something similar). Our template can be found here https://github.com/graphql-elixir/plug_graphql/blob/master/templates/graphiql.eex\r\n\r\nWe found some issues when we took this template verbatim before line 111."},"comment":{"url":"https://api.github.com/repos/graphql/graphiql/issues/comments/228132232","html_url":"https://github.com/graphql/graphiql/pull/146#issuecomment-228132232","issue_url":"https://api.github.com/repos/graphql/graphiql/issues/146","id":228132232,"user":{"login":"asiandrummer","id":1537569,"avatar_url":"https://avatars.githubusercontent.com/u/1537569?v=3","gravatar_id":"","url":"https://api.github.com/users/asiandrummer","html_url":"https://github.com/asiandrummer","followers_url":"https://api.github.com/users/asiandrummer/followers","following_url":"https://api.github.com/users/asiandrummer/following{/other_user}","gists_url":"https://api.github.com/users/asiandrummer/gists{/gist_id}","starred_url":"https://api.github.com/users/asiandrummer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asiandrummer/subscriptions","organizations_url":"https://api.github.com/users/asiandrummer/orgs","repos_url":"https://api.github.com/users/asiandrummer/repos","events_url":"https://api.github.com/users/asiandrummer/events{/privacy}","received_events_url":"https://api.github.com/users/asiandrummer/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T18:02:30Z","updated_at":"2016-06-23T18:02:30Z","body":"Me neither, but props for solving the issue! Thanks for the contributions :D\r\nI was caught up solving this linter issue, but what do you think about optionally parameterizing the custom endpoint pathname? Something like:\r\n```\r\nfunction graphQLFetcher(graphQLParams, endpointURL = '/graphql') {\r\n  return fetch(window.location.origin + endpointURL, {});\r\n}\r\n```\r\nThis way we can customize the URL as we want, but it'll default to `/graphql` when not supplied. Aside form the customization, I was also thinking this change may break other applications if it relies on `/graphql` URL to use fetcher somehow."}}
{"actor":{"display_login":"asiandrummer"}}