Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate document for graphql api ? #4

Closed
twilroad opened this issue Jan 8, 2018 · 10 comments
Closed

How to generate document for graphql api ? #4

twilroad opened this issue Jan 8, 2018 · 10 comments

Comments

@twilroad
Copy link

twilroad commented Jan 8, 2018

With @nestjs/graphql, how to generate document for graphql api ?
image
There is No Description.

@iamclaytonray
Copy link

iamclaytonray commented Jan 12, 2018

Try adding a comment above the type or field you'd like to have a description for. IE:

# This is a Post
type Post {
  # A unique identifier
  id: ID!
}

@rgolea
Copy link

rgolea commented Feb 23, 2018

@kamilmysliwiec, @iamclaytonray For me it's not working either. And yes, I do have the description set. Just for some reason it gets discarded. Any idea? I believe it comes from the merge-graphql-schemas module. Nest (nestjs/graphql) uses ^1.3.0 and the module is on it's 1.4.0 version. Not really sure if it affects. Can anyone help?
screen shot 2018-02-23 at 14 21 36
And yes, the image is a comment for the interface but I added to types, interfaces, parameters, etc and I still don't have anything inside the docs.

@iamclaytonray
Copy link

iamclaytonray commented Feb 23, 2018

@rgolea - Can you shoot over a small repro? I'll test it out locally and get back with you

@rgolea
Copy link

rgolea commented Feb 23, 2018

@iamclaytonray not sure how. As far as I can gather, the typedefs come from the documents without the comments. Does it work for you? This is my package.json:

"dependencies": {
    "@nestjs/common": "^4.6.4",
    "@nestjs/core": "^4.6.4",
    "@nestjs/graphql": "^2.0.0",
    "@nestjs/testing": "^4.6.1",
    "apollo-server-express": "^1.3.2",
    "graphql": "^0.13.1",
    "graphql-tools": "^2.21.0",
    "reflect-metadata": "^0.1.12",
    "rxjs": "^5.5.6",
     ...
  }

@iamclaytonray
Copy link

Yep, works for me

@rgolea
Copy link

rgolea commented Feb 23, 2018

@iamclaytonray is there any way we can talk in private? Gitter?

@iamclaytonray
Copy link

Yeah, let me make an account real quick

@rgolea
Copy link

rgolea commented Apr 4, 2018

This was happening because of the version of graphql. Use 0.11.7.

@danil-z
Copy link

danil-z commented Jan 16, 2019

I have a same issue

my package json:

$ grep -i graphql package.json
    "@nestjs/graphql": "^5.5.1",
    "@types/graphql": "^14.0.5",
    "graphql": "^14.1.0",
    "graphql-iso-date": "^3.6.1",
    "graphql-tools": "^4.0.3",
    "graphql-type-json": "^0.2.1",

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants