Last active
January 20, 2017 09:18
-
-
Save tlrobinson/d54fc3ea5fa1f0b7ca457771925e5332 to your computer and use it in GitHub Desktop.
Minimal GraphiQL + React Router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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