graphql-code-generator doesn't work with meteor-graphql-rxjs
See original GitHub issueThis 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:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
This is a very old issue, and a lot has changed since then. Please reopen if someone still having this issue.