Closed Gbahdeyboh closed 1 year ago
For now, the descriptions are included in the queries as comments, but I agree that it would be nice to put it in this more appropriate space.
Hey @Gbahdeyboh I got an issue on this one. In the postman collection spec the description is as:
"item": {
"...":"...",
"description": "..."
}
However, when doing that no description is shown in postman, and if I manually add one and export the collection, I get the following scheme:
"item": {
"...":"...",
"request": {
"...":"...",
"description": "..."
}
}
Complete context:
{
"name":"character",
"request":{
"method":"POST",
"header":[
],
"body":{
"mode":"graphql",
"graphql":{
"query":"query character($id: ID!) {\n character(id: $id) {\n __typename\n id # The id of the character.\n name # The name of the character.\n status # The status of the character ('Alive', 'Dead' or 'unknown').\n species # The species of the character.\n type # The type or subspecies of the character.\n gender # The gender of the character ('Female', 'Male', 'Genderless' or 'unknown').\n # origin # The character's origin location\n # location # The character's last known location\n image # Link to the character's image. All images are 300x300px and most are medium shots or portraits since they are intended to be used as avatars.\n # episode # Episodes in which this character appeared. # Type: NON_NULL\n created # Time at which the character was created in the database.\n }\n}",
"variables":"{\n\t\"id\": \"0\"\n}"
}
},
"url":{
"raw":"https://rickandmortyapi.com/graphql",
"protocol":"https",
"host":[
"rickandmortyapi",
"com"
],
"path":[
"graphql"
]
},
"description":"exported description from postman"
},
"response":[
],
"description":"description as described in the docs"
}
Note: move the description to the request level
GraphQL provides us with the option to include descriptions in our schema. Descriptions can be field or list descriptions. Tools like GraphiQL use these descriptions in the generated documentation for any GraphQL schema.
These same behaviors can be replicated in collections as well. It helps the consumer of that collection with additional with some additional context.