Sha256: 00456a168b755c4e7f1d87d0e855c4ead5813e9a8b36ee6a9a554f4cba4e22dd

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

<!DOCTYPE html>
<html>
  <head>
    <title>GraphQL Voyager</title>
    <%= stylesheet_link_tag("graphql/voyager/rails/application") %>
    <%= javascript_include_tag("graphql/voyager/rails/application") %>
  </head>
  <body>
    <div id="voyager">Loading...</div>
    <script>
      function introspectionProvider(introspectionQuery) {
        return fetch('<%= graphql_endpoint_path %>', {
          method: 'post',
          headers: <%= GraphQL::Voyager::Rails.config.resolve_headers(self).to_json.html_safe %>,
          body: JSON.stringify({query: introspectionQuery}),
          credentials: 'include',
        }).then(function (response) {
          return response.text();
        }).then(function (responseBody) {
          try {
            return JSON.parse(responseBody);
          } catch (error) {
            return responseBody;
          }
        });
      }

      GraphQLVoyager.init(document.getElementById('voyager'), {
        introspection: introspectionProvider,
        workerURI: '<%= asset_path("graphql/voyager/rails/voyager.js") %>',
      });
    </script>
  </body>
</html>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graphql-voyager-rails-1.0.2 app/views/graphql/voyager/rails/explorers/show.html.erb
graphql-voyager-rails-1.0.1 app/views/graphql/voyager/rails/explorers/show.html.erb