From a6e7bbdcd4c86ba592f23e6f378baa4f74ee312f Mon Sep 17 00:00:00 2001 From: Hyo Jeong Date: Tue, 1 Nov 2016 15:33:17 -0700 Subject: [PATCH] Append `graphql` to the fetcher URL in template [This PR](https://github.com/graphql/graphiql/pull/146) changed the fetcher URL to be relative - due to my carelessness this broke GraphiQL example code. I'd like to propose the change that will let you keep the relativeness of the fetcher URL and still have a specific endpoint URL for graphql execution-related requests. --- templates/graphiql.eex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/graphiql.eex b/templates/graphiql.eex index e242014..eda37fb 100644 --- a/templates/graphiql.eex +++ b/templates/graphiql.eex @@ -91,7 +91,7 @@ add "&raw" to the end of the URL within a browser. function graphQLFetcher(graphQLParams) { // NOTE: This fetch URL should be relative to the current URL // This is so that the GraphQL Elixir Plug can be mounted anywhere - return fetch(window.location.origin + window.location.pathname, { + return fetch(window.location.origin + window.location.pathname + 'graphql', { method: 'post', headers: { 'Accept': 'application/json',