Describe the bug
The Typescript example given in the docs doesn't work. Instead it throws this error:
Plugin typescript does not export a valid JS object with "plugin" function.
I'm just using the built-in typescript plugin.
To Reproduce
Follow the quickstart, use the config from the Typescript example in the documentation
My GraphQL schema:
Not schema related. Try any schema.
My GraphQL operations:
N/A
codegen.yml config file:schema: http://localhost:1337/graphql
documents: ./src/**/*.graphql
generates:
./src/types.ts:
plugins:
- typescript
Expected behavior
The library should work as advertised, doing what it claims to do in the docs.
Please stop with the radical changes. This library was working wonderfully a few months ago. It's eating valuable dollars and time right now.
When I download a library, I expect the docs on the library's website to be for the same version of the current release. However, the docs are clearly out of touch. Notice the Programmatic usage section.
Environment:
Node v10.10.0 on a 2018 Macbook pro
Lib version: 1.0.7, the current release.
Additional context
It was working before 1.0 broke everything.
I ran through everything again from scratch, this time using the cli init command instead of copying the yml file from the Typescript example in the docs. It worked. Seems the docs are out of date...
For reference, here are a few parts of my old workflow that the 1.0.X updates have broken:
All in all, I feel that 1.0 has been released prematurely.
Hi @robbyemmert ,
A few notes regarding the issues you had:
yml you used, I'm not sure what it is, because I couldn't reproduce it, and you didn't provide a repository than reproduces it.graphql to be globally installed. If you install the codegen as global dependency, than yes, you need graphql to be global as well. We do not recommend to install it globally.Regarding the API changes:
Regarding the output changes:
Also, a note about open-source:
This project is an open-source, and we are a team of developers, putting our best efforts to make this library free, reliable, customizable and easy-to-use. We are constantly upgrading it and adding more plugins and more features. Sometimes things breaks, but that's the beauty of open-source - you can always participate and contribute.
If you think something is not right or not updated - you can always open a PR that fixes it and not just open an issue and complain.
And in a more personal manner - if you thing that we are wasting your "valuable dollars and time" - please do not use this library at all. There are other solution for generating code from GraphQL.
We will always introduce "radical changes" because GraphQL (and software, in general) evolves all the time, and we must stay on top of it if we want this package to remain relevant.
I know not all your expectations are met with the 1.0 release, but my expectations from the community is to take an active part on developing it, and not just complaining about it.
@dotansimha It will be great to provide a solution to this issue. I am facing the same error using the library out of the box. My codegen.yml is:
overwrite: true
schema: "./schema.graphql"
documents: null
generates:
./types.ts:
plugins:
- "typescript"
I get the error Plugin typescript does not export a valid JS object with "plugin" function.
Most helpful comment
Hi @robbyemmert ,
A few notes regarding the issues you had:
ymlyou used, I'm not sure what it is, because I couldn't reproduce it, and you didn't provide a repository than reproduces it.graphqlto be globally installed. If you install the codegen as global dependency, than yes, you needgraphqlto be global as well. We do not recommend to install it globally.Regarding the API changes:
Regarding the output changes:
Also, a note about open-source:
This project is an open-source, and we are a team of developers, putting our best efforts to make this library free, reliable, customizable and easy-to-use. We are constantly upgrading it and adding more plugins and more features. Sometimes things breaks, but that's the beauty of open-source - you can always participate and contribute.
If you think something is not right or not updated - you can always open a PR that fixes it and not just open an issue and complain.
And in a more personal manner - if you thing that we are wasting your "valuable dollars and time" - please do not use this library at all. There are other solution for generating code from GraphQL.
We will always introduce "radical changes" because GraphQL (and software, in general) evolves all the time, and we must stay on top of it if we want this package to remain relevant.
I know not all your expectations are met with the 1.0 release, but my expectations from the community is to take an active part on developing it, and not just complaining about it.