Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Last active January 20, 2017 09:18
Show Gist options
  • Save tlrobinson/d54fc3ea5fa1f0b7ca457771925e5332 to your computer and use it in GitHub Desktop.
Save tlrobinson/d54fc3ea5fa1f0b7ca457771925e5332 to your computer and use it in GitHub Desktop.
Minimal GraphiQL + React Router
export default
<Route path="/graphiql" component={() =>
<GraphiQL fetcher={(graphQLParams) =>
fetch(window.location.origin + '/graphql', {
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(graphQLParams),
credentials: 'same-origin',
}).then(response => response.json())
} />
} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment