Graphiql: Autocomplete not working properly in aliases - version 0.8.0

Created on 19 Nov 2016  路  2Comments  路  Source: graphql/graphiql

GraphiQL autocomplete shows wrong hints when used in aliased field.
This problem doesn't occurs in version 0.7.0.

My code look like this

import graphqlHTTP from 'express-graphql';
import {
    GraphQLSchema,
    GraphQLObjectType,
    GraphQLString
} from 'graphql';

const Schema = new GraphQLSchema({
    query: new GraphQLObjectType({
        name: 'Query',
        fields: {
            article: {
                type: new GraphQLObjectType({
                    name: 'Article',
                    fields: {
                        title: { type: GraphQLString },
                        content: { type: GraphQLString }
                    }
                }),
                resolve() {
                    return {
                        title: 'Lorem ipsum',
                        content: 'Sed ut perspiciatis'
                    };
                },
            },
        },
    }),
});

app.use('/graphql', graphqlHTTP({
    schema: Schema,
    graphiql: true
}));

This is how it looks like in graphiql

  1. Root autocomplete works properly

screen shot 2016-11-19 at 20 39 12

  1. Article autocomplete works properly

screen shot 2016-11-19 at 20 39 33

  1. Autocomplete on aliased article shows root fields! - it's broken.

screen shot 2016-11-19 at 20 51 15

Version of packages

"express-graphql": "0.6.1",
"graphql": "0.8.2",

graphiql is served from CDN: http://cdn.jsdelivr.net/graphiql/0.8.0/graphiql.min.js

bug

Most helpful comment

Thanks for the report @Everettss - this is a known issue and we're working to resolve it as soon as possible.

All 2 comments

Thanks for the report @Everettss - this is a known issue and we're working to resolve it as soon as possible.

Fixed under v0.5.9 release. graphiql updated to reflect the changes in 9157a7.

Thanks for the report!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukaszczapiga picture lukaszczapiga  路  5Comments

stubailo picture stubailo  路  3Comments

Nishchit14 picture Nishchit14  路  5Comments

davidianlandis picture davidianlandis  路  3Comments

ganemone picture ganemone  路  4Comments