Giter Site home page Giter Site logo

graphql-docs's People

Contributors

mhallin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

graphql-docs's Issues

Feature: A command-line markdown generator.

I'm looking for some aspects of this project, I'm looking to contribute or find a solution that properly fits my needs.

The gist is, I just want to generate the static markdown from the command line. Is this possible with your project? Ideas? What do you think?

Union Type suppport

I have a UnionType in my schema, and when I view the docs via the React App I see: Error: Unsupported type ref kind: UNION

Generating via CLI also fails if the UNION type is present (no error displayed, just doesn't generate)

When I generate the docs via CLI with the union type removed from my Schema, the docs generate fine.

cannot read property __schema of undefined

Got this message after did an html generation file :

graphql-docs-gen http://localhost:56911/v1/graphql documentation.html

Error coming from this block


        var Schema = exports.Schema = function() {
            function Schema(introspectionResult) {
                var _this = this;

                _classCallCheck(this, Schema);

                if (!introspectionResult.__schema) { // here !
                    throw new Error('Function "Schema" precondition failed: introspectionResult.__schema');
                }

If I run this from GraphiQL ->

query {
  __schema {
    queryType{
      name
    }
  }
}

got this :

{
  "data": {
    "__schema": {
      "queryType": {
        "name": "query_root"
      }
    }
  }
}

input types

Any reason as to why input types are not documented ?

Isomorphic apps

Hi there,

Thanks for the nice module. I've promoted it on SO

Any thoughts on how to make it easier to use it in an isomorphic app context? On the server side I get:

***/node_modules/graphql-docs/dist/webpack:/~/style-loader/addStyles.js:31
 	if (typeof options.singleton === "undefined") options.singleton = isOldIE();
 ^
 ReferenceError: window is not defined

Maybe related to #4 ?

Cheers,

Jun

Feature Request: Better way to drop into server.

Right now I have this file in a utils.js somewhere on my server.

It would be sweet if I didn't need to rely on any other services here and really utilize the npm dependency. This feels kind of hacky.

export let staticDocsHTML = () => {
  return `
    <!DOCTYPE html>
    <html>
        <head>
            <title>GraphQL Docs</title>
        </head>

        <body>
            <div id="app"></div>

            <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.2/react.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.2/react-dom.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/1.0.0/fetch.min.js"></script>
            <script src="https://github.com/mhallin/graphql-docs/releases/download/v0.1.4/graphql-docs.min.js"></script>
            <script>
                function fetcher(query) {
                    return fetch(window.location.origin + '/graphql', {
                        method: 'POST',
                        headers: {
                            Accept: 'application/json',
                            'Content-Type': 'application/json',
                        },
                        body: JSON.stringify({
                            query: query,
                        }),
                    }).then(function(r) {
                        return r.json();
                    });
                }
                const rootElem = document.getElementById('app');
                ReactDOM.render(
                    React.createElement(
                        GraphQLDocs.GraphQLDocs,
                        {
                            fetcher: fetcher,
                        }),
                    rootElem
                );
            </script>
        </body>
    </html>
  `
}

introspectionResult is undefined

Screenshot 2019-12-16 at 01 03 06

<html>
  <head>
    <title>Docs</title>
    <script src="https://unpkg.com/react@15/dist/react.js"></script>
    <script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
    <script src="https://github.com/mhallin/graphql-docs/releases/download/v0.2.0/graphql-docs.js"></script>
  </head>
  <body>
    <div id="root"></div>
    <script>
      window.onload = function()
      {
        function fetcher(query) {
          return fetch('http://localhost:3000/graphql', {
            method: 'POST',
            headers: {
              Accept: 'application/json',
              'Content-Type': 'application/json',
            },
            body: JSON.stringify({
              query: query,
            }),
          }).then(function(r) {
            return r.json();
          });
        }

        ReactDOM.render(
          React.createElement(GraphQLDocs.GraphQLDocs, { fetcher }),
          document.getElementById('root')
        );
      };
    </script>
  </body>
</html>

Allow to override layout

Hi there,

It would be great if some of the layout variables (particularly this 800px fixed width container) could be provided as a prop to the component!

Cheers,

Jun

Uncaught (in promise) Error: Unsupported type ref kind: UNION

Are union types not supported yet? I'm getting this error:

Uncaught (in promise) Error: Unsupported type ref kind: UNION
    at Function.value (file:///Users/jgeller/Development/ng/clients/desktop/electron/output.html:15:6969)
    at new t (file:///Users/jgeller/Development/ng/clients/desktop/electron/output.html:15:7164)
    at Function.value (file:///Users/jgeller/Development/ng/clients/desktop/electron/output.html:15:6877)
    at new v (file:///Users/jgeller/Development/ng/clients/desktop/electron/output.html:15:6546)
    at file:///Users/jgeller/Development/ng/clients/desktop/electron/output.html:15:5419
    at Array.map (native)
    at new t (file:///Users/jgeller/Development/ng/clients/desktop/electron/output.html:15:5396)
    at Function.value (file:///Users/jgeller/Development/ng/clients/desktop/electron/output.html:15:5029)
    at file:///Users/jgeller/Development/ng/clients/desktop/electron/output.html:15:4309
    at Array.forEach (native)

Did not get HTTP 200 back from the endpoint

I already installed graphql-docs (globally) and now when I run below command
graphql-docs-gen MY-GRAPHQL-ENDPOINT doc.html
It returns with Did not get

HTTP 200 back from the endpoint error message.

Any idea how to fix it?

url fragments not working

When I click an item and send it to someone and they visit the fragment in the url doesn't take them anywhere on the page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.