question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

graphql-code-generator doesn't work with meteor-graphql-rxjs

See original GitHub issue

This is with the http://localhost:3000/graphql endpoint, using apollo-server-express:

[niko@arch-desktop angularcli-graphql]$ npm run generator

> angularcli-graphql@0.0.0 generator /home/niko/WebstormProjects/angularcli-graphql
> gql-gen --url http://localhost:3000/graphql --template ts --out ./src/types.d.ts "./src/graphql/**/*.ts"

Loading GraphQL Introspection from remote: http://localhost:3000/graphql...
Generated file written to /home/niko/WebstormProjects/angularcli-graphql/src/types.d.ts

This is with the http://localhost:3000/graphql_live endpoint, using meteor-graphql-rxjs:

[niko@arch-desktop angularcli-graphql]$ npm run generator

> angularcli-graphql@0.0.0 generator /home/niko/WebstormProjects/angularcli-graphql
> gql-gen --url http://localhost:3000/graphql_live --template ts --out ./src/types.d.ts "./src/graphql/**/*.ts"

Loading GraphQL Introspection from remote: http://localhost:3000/graphql_live...
/home/niko/WebstormProjects/angularcli-graphql/node_modules/graphql-code-generator/dist/loaders/introspection-from-url.js:43
                reject('Unable to download schema from remote: ' + body.errors.map(function (item) { return item.message; }).join(', '));
                                                                               ^

TypeError: Cannot read property 'map' of undefined
    at Request._callback (/home/niko/WebstormProjects/angularcli-graphql/node_modules/graphql-code-generator/dist/loaders/introspection-from-url.js:43:80)
    at Request.self.callback (/home/niko/WebstormProjects/angularcli-graphql/node_modules/request/request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/home/niko/WebstormProjects/angularcli-graphql/node_modules/request/request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (/home/niko/WebstormProjects/angularcli-graphql/node_modules/request/request.js:1091:12)
    at Object.onceWrapper (events.js:312:30)
    at emitNone (events.js:110:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angularcli-graphql@0.0.0 generator: `gql-gen --url http://localhost:3000/graphql_live --template ts --out ./src/types.d.ts "./src/graphql/**/*.ts"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angularcli-graphql@0.0.0 generator script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/niko/.npm/_logs/2017-10-31T11_50_46_395Z-debug.log

To test it, check out the following: Server: https://github.com/Urigo/WhatsApp-Server-GraphQL-Live-RxJS-Meteor Run the server with npm start Client: https://github.com/darkbasic/angularcli-graphql Run the generator with npm run generator (edit the url to http://localhost:3000/graphql_live first). Run the client with ng serve.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
daverickdunncommented, Jan 15, 2018

I’m getting the exact same error.

I’m using Graphene however, and GraphiQL is running fine. In fact, I have the gql-gen command saved as a script in my package.json, I used it a few times last October with no issues. Since then I’ve changed nothing about the the command or the server’s config. The only thing I’ve done is add a few new queries/mutations.

I went back through the git commits, the package version is the same now as then: “graphql-code-generator”: “^0.8.14”

Can’t say the same for dependencies tough.

EDIT: My mistake, I forgot a step in my process. I have to wrap the graphene view in a csrf_exempt method to bypass authorisation. Facing a new error now, but it’s unrelated.

0reactions
dotansimhacommented, Nov 16, 2018

This is a very old issue, and a lot has changed since then. Please reopen if someone still having this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate GraphQL Types with Apollo Codegen Tutorial
TypeScript GraphQL Code Generator – Generate GraphQL Types with ... And if it doesn't work — don't panic; there's likely a great reason...
Read more >
Integrating GraphQL Code Generator in your frontend ...
In this article we'll try to explain and demonstrate common patterns for frontend development with GraphQL and GraphQL Code Generator.
Read more >
GraphQL Code Generator -Introducing Hooks support for ...
Just use GraphQL Code Generator's Typescript-React-Apollo Plugin, set withHooks: true to your GraphQL Code Generator config, and add react- ...
Read more >
Three Key Steps to Fast Loader Functions - Remix Guide
Fly.io has been a dream to work with so far, and the monitoring story is no ... We successfully switched from Meteor.js to...
Read more >
How to use GraphQL Code Generator with React and Apollo
Nhost is an open source Firebase alternative with GraphQL, built with the following things in mind: Open Source, GraphQL, SQL, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found