graphdoc
graphdoc copied to clipboard
Does not support GraphQL comments
I have a schema.graphql. The tool does not like the comment and gave the following error
✗ Syntax Error GraphQL (6:1) Unexpected String
5:
6: """The available actions for this resource."""
^
7: type actions {
Got the same bug:
events.js:165
throw er; // Unhandled 'error' event
^
Error: Command failed: yarn graphdoc -s /home/john/schema.graphql -o /home/john/graphql --force --data '{"ga":"UA-..."}'
✗ Syntax Error GraphQL (1:1) Unexpected String
1: """
^
2: Autogenerated input type of DemoOnly
Before that my IDL documents had and inline comment using # so it worked as expected.
Hey, I got the same problem today, because I'm updating my GraphQL libs. I kind of resolved the comment/description issue by enabling the option { commentDescriptions: true } in my printSchema function, so I wouldn't have the triple quote descriptions.
But new GraphQL schemas also introduce a new way of interfacing types, with "&" instead of comma. That also breaks graphdoc, and I don't know how to solve it.
Does anyone know if this repo is maintained?
This should at least be renamed into "Does not support GraphQL descriptions" since the triple quotes indicate a description (see https://graphql.github.io/graphql-spec/draft/#sec-Descriptions).
This issue seems like a duplicate of #51.
I found that upgrading the dependent graphql package can solve this issue.
Workaround:
- Change dependency to use
2fd/graphdoc#dependabot/npm_and_yarn/graphql-14.6.0 - Manually
cdto@2fd/graphdocand runnpm i && npm run compile cdback to your project directory and perform command as usual
It would be grateful if @2fd could merge https://github.com/2fd/graphdoc/pull/127 so that the issue could be fixed.
Any news on the pull request?
Two years... Seems like it's abandoned. Lack of support for description strings is a dealbreaker for me :(
It's a pity that the project is left to die. That's also a complete deal breaker for me.
Hi,
I disagree with the choice of words "deal breaker" makes it sound like the open source author was getting a deal from sharing their creation with you... it happens a lot with open source projects, they do get abandoned from time to time, what's great is that this is open source so you can fork and maintain yourself.
In my case all I wanted was support to "triple quotes", and bumping dependencies was enough to me, you can check the 2 commits I did on my fork:
- https://github.com/wealthsimple/graphdoc/commit/84a3d86ddb0b2bf5f748da93e412a11cab0191ee
- https://github.com/wealthsimple/graphdoc/commit/1f8461106feedff05da1b3568974c89f19b67338
The original author has moved to other projects and that's totally fine. ❤️
Good luck to you all!
It's totally fine that they moved on but a pity nevertheless. This breaks the deal "I publish, you use it". But that might be a semantic issue and is not intended as critique for the authors.
Nevertheless, thanks @cabello for the pointer to your fork 👍
I wasn't trying to accuse anyone. :) It's just a statement of facts: project looks abandoned which is a pitty for anyone that was interested in using it. For me it means that I won't be using it in my project. But I might use your fork, thanks!
English is not my native language so sorry if I misused the phrase.
A workaround for this issue is to tie the required graphql version in the transitive dependency using resolutions field of package.json file . This is described in How to configure graphdoc, as well some online examples are provided, for npm and yarn`.
The original author has moved to other projects and that's totally fine. ❤️
Of course, nobody should be expected to maintain their project for life. But the polite thing to do is mark it as archived/deprecated instead of silently moving on to other projects. That way, developers don't go down a path of starting to use the project and then come to find the lack of support later on and continue to open issues on GitHub that won't be resolved.