Insomnia: [Feature Request] Show enum information in GraphQL schema explorer

Created on 9 Oct 2019  路  6Comments  路  Source: Kong/insomnia

  • Insomnia Version: 7.0.1
  • Operating System: Ubuntu 18.04

Details

I noticed that the GraphQL schema explorer does not list the available values on enums.

An introspection query like the following will give the information about the given enum:

{
  __type(name: "SomeFancyEnum") {
    enumValues {
      name
      description
      isDeprecated
      deprecationReason
    }
  }
}

For me, using HotChocolate for .Net Core, the above returns something like:

{
  "data": {
    "__type": {
      "enumValues": [
        {
          "name": "REINDEER",
          "description": "Sleigh propulsion system",
          "isDeprecated": false,
          "deprecationReason": null
        },
        {
          "name": "SANTA",
          "description": "Flag a thing as being Santa",
          "isDeprecated": false,
          "deprecationReason": null
        },
        {
          "name": "SATAN",
          "description": "Flag a thing as being Santa",
          "isDeprecated": true,
          "deprecationReason": "Ooops.. typo"
        }
      ]
    }
  }
}
accepted good first issue

Most helpful comment

How's this?

image

All 6 comments

馃憢 Thanks for opening your first issue! If you're reporting a 馃悶 bug, please make sure
you include steps to reproduce it. If you're requesting a feature 馃巵, please provide real
use cases that would benefit. 馃應

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

I was going to open an issue to ask for this feature!

In GraphQL there is a enum type which is a list of allowed values.

In many GraphiQL interfaces, the documentation shows all the allowed values that an enum can take. This is very useful for the users of the GraphQL API so they can see which values they can use when they are using the API

Ah yes, I just forgot to implement docs for enum types. Should be an easy addition! 馃憤

I've also noticed that enum types docs aren't shown too!

How's this?

image

Thank you for this @gschier. It is a very nice addition :)

Was this page helpful?
0 / 5 - 0 ratings