graph-gophers / graphql-go

GraphQL server with a focus on ease of use
BSD 2-Clause "Simplified" License
4.64k stars 491 forks source link

GraphiQL weirdness (showing "undefined" as type of fields), or underlying issue? #104

Open dmitshur opened 7 years ago

dmitshur commented 7 years ago

I was playing with the starwars example with the provided GraphiQL frontend, and noticed the following unexpected behavior. When using autocomplete to see the fields available, the type of each field is shown to be "undefined":

image

However, when hovering over the same field, it shows the type correctly:

image

I've previously used GitHub's GraphiQL Explorer at https://developer.github.com/v4/explorer/, which does not have this issue:

image

Is this a bug in GraphiQL, or is it some underlying issue in the GraphQL server or the starwars schema?

acornejo commented 7 years ago

AFAICT This is a bug in GraphiQL, upgrading the library to 11.2 gets rid of this issue (althogh the type is no longer displayed, but that was just a change upstream).

nfisher commented 6 years ago

I'm running the latest version of GraphiQL. I've noticed if you comment your fields it will provide that in the description which is kind of nice.

An example is as follows;

        # created is the date this product was created in YYYY-MM-DD format.
        created: String!

Which is displayed as follows;

screen shot 2018-01-07 at 05 44 48