public/javascripts/app-graphiql.js
// Defines a GraphQL fetcher using the fetch API.
Defines a GraphQL fetcher using the fetch API.
Defines a GraphQL fetcher using the fetch API .
function graphQLFetcher(graphQLParams) {
    return fetch(window.location.origin + '/graphql', {
      method: 'post',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(graphQLParams),
      credentials: 'include'
    }).then(function (response) {
      return response.text();
    }).then(function (responseBody) {
      try {
        return JSON.parse(responseBody);
      } catch (error) {
        return responseBody;
      }
    });
  }
function graphQLFetcher ( graphQLParams ) { return fetch ( window . location . origin + '/graphql' , { method : 'post' , headers : { 'Accept' : 'application/json' , 'Content-Type' : 'application/json' } , body : JSON . stringify ( graphQLParams ) , credentials : 'include' } ) . then ( function ( response ) { return response . text ( ) ; } ) . then ( function ( responseBody ) { try { return JSON . parse ( responseBody ) ; } catch ( error ) { return responseBody ; } } ) ; }
Defines a GraphQL fetcher using the fetch API.
Defines a GraphQL fetcher using the fetch API .