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

No document for mutation with multiple arguments #33

Closed
lednhatkhanh opened this issue Aug 25, 2017 · 5 comments
Closed

No document for mutation with multiple arguments #33

lednhatkhanh opened this issue Aug 25, 2017 · 5 comments

Comments

@lednhatkhanh
Copy link

type Mutation {
  # Register new user, need to remove Authorization and RefreshToken headers
  register(
    # User firstname
    firstname: String!
    # User lastname
    lastname: String!
    # User email address
    email: String!
    # User password
    password: String!
  ): User!
  # Login to system, need to remove Authorization and RefreshToken headers
  login(
    # User email address
    email: String!
    # User password
    password: String!
  ): LoginResponse
}

But got this:
image

So how can I make the document display for arguments?

@2fd
Copy link
Owner

2fd commented Aug 25, 2017

The latest version is showing the comments correctly.
https://2fd.github.io/graphdoc/shopify/mutation.doc.html

captura de pantalla 2017-08-25 a la s 17 24 00

Which one are you using?
From what scheme are you generating the documentation? IDL, HTTP or JSON?

@lednhatkhanh
Copy link
Author

I installed it as a dependence: "@2fd/graphdoc": "^2.4.0" for my project and then add this script to my package.json:

"graphdoc": {
    "endpoint": "http://localhost:5000/graphql",
    "output": "./doc/schema"
  },
"scripts": {
    "doc": "graphdoc -f"
  },

And that's what I got when running npm run doc.

@2fd
Copy link
Owner

2fd commented Aug 27, 2017

Could you run the following query and post the result?

fragment FullType on __Type {
  fields(includeDeprecated: true) {
    name
    description
    args {
      ...InputValue
    }
    type {
      ...TypeRef
    }
    isDeprecated
    deprecationReason
  }
  inputFields {
    ...InputValue
  }
  interfaces {
    ...TypeRef
  }
  enumValues(includeDeprecated: true) {
    name
    description
    isDeprecated
    deprecationReason
  }
  possibleTypes {
    ...TypeRef
  }
}

fragment InputValue on __InputValue {
  name
  description
  type {
    ...TypeRef
  }
  defaultValue
}

fragment TypeRef on __Type {
  kind
  name
  description
  ofType {
    kind
    name
    description
    ofType {
      kind
      name
      description
      ofType {
        kind
        name
        description
        ofType {
          kind
          name
          description
          ofType {
            kind
            name
            description
            ofType {
              kind
              name
              description
              ofType {
                kind
                name
                description
              }
            }
          }
        }
      }
    }
  }
}

{
  __type(name: "Mutation") {
    name
    kind
    description
    ...FullType
  }
}

@lednhatkhanh
Copy link
Author

Thank you for the response, here is the result:

  "data": {
    "__type": {
      "name": "Mutation",
      "kind": "OBJECT",
      "description": "",
      "fields": [
        {
          "name": "register",
          "description": "Register new user, need to remove Authorization and RefreshToken headers",
          "args": [
            {
              "name": "firstname",
              "description": "",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "description": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
                  "ofType": null
                }
              },
              "defaultValue": null
            },
            {
              "name": "lastname",
              "description": "",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "description": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
                  "ofType": null
                }
              },
              "defaultValue": null
            },
            {
              "name": "email",
              "description": "",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "description": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
                  "ofType": null
                }
              },
              "defaultValue": null
            },
            {
              "name": "password",
              "description": "",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "description": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
                  "ofType": null
                }
              },
              "defaultValue": null
            }
          ],
          "type": {
            "kind": "NON_NULL",
            "name": null,
            "description": null,
            "ofType": {
              "kind": "OBJECT",
              "name": "User",
              "description": "",
              "ofType": null
            }
          },
          "isDeprecated": false,
          "deprecationReason": null
        },
        {
          "name": "login",
          "description": "Login to system, need to remove Authorization and RefreshToken headers",
          "args": [
            {
              "name": "email",
              "description": "",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "description": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
                  "ofType": null
                }
              },
              "defaultValue": null
            },
            {
              "name": "password",
              "description": "",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "description": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "String",
                  "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",
                  "ofType": null
                }
              },
              "defaultValue": null
            }
          ],
          "type": {
            "kind": "OBJECT",
            "name": "LoginResponse",
            "description": "",
            "ofType": null
          },
          "isDeprecated": false,
          "deprecationReason": null
        }
      ],
      "inputFields": null,
      "interfaces": [],
      "enumValues": null,
      "possibleTypes": null
    }
  }
}

@2fd
Copy link
Owner

2fd commented Aug 28, 2017

In your schema all parameter descriptions are empty strings

    {
              "name": "firstname",
              "description": "",   //   <--- Parameter description is empty string
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "description": null,
                "ofType": { /* ... */ }
              },
              "defaultValue": null
    }

How are you generating your schema?

@2fd 2fd closed this as completed Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants