graphdoc icon indicating copy to clipboard operation
graphdoc copied to clipboard

Does not support GraphQL comments

Open candysmurf opened this issue 7 years ago • 12 comments
trafficstars

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 {

candysmurf avatar Nov 19 '18 16:11 candysmurf

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.

cabello avatar Jan 15 '19 19:01 cabello

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?

ghost avatar Mar 20 '19 13:03 ghost

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).

arifC avatar Jul 25 '19 13:07 arifC

This issue seems like a duplicate of #51.

I found that upgrading the dependent graphql package can solve this issue.

Workaround:

  1. Change dependency to use 2fd/graphdoc#dependabot/npm_and_yarn/graphql-14.6.0
  2. Manually cd to @2fd/graphdoc and run npm i && npm run compile
  3. cd back 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.

MrOrz avatar Jun 12 '20 10:06 MrOrz

Any news on the pull request?

fabrykowski avatar Oct 22 '20 11:10 fabrykowski

Two years... Seems like it's abandoned. Lack of support for description strings is a dealbreaker for me :(

sirtopp avatar Oct 27 '20 14:10 sirtopp

It's a pity that the project is left to die. That's also a complete deal breaker for me.

userlarsb avatar Oct 28 '20 08:10 userlarsb

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!

cabello avatar Oct 28 '20 20:10 cabello

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 👍

userlarsb avatar Oct 29 '20 07:10 userlarsb

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.

sirtopp avatar Oct 29 '20 07:10 sirtopp

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`.

gmullerb avatar Jun 01 '21 17:06 gmullerb

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.

apastel avatar Mar 19 '24 23:03 apastel