graphql-docs icon indicating copy to clipboard operation
graphql-docs copied to clipboard

cannot read property __schema of undefined

Open chsi13 opened this issue 4 years ago • 0 comments

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"
      }
    }
  }
}

chsi13 avatar Jan 27 '21 07:01 chsi13