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

undefinedConnection name for a connection definition #151

Closed
excitement-engineer opened this issue Feb 25, 2017 · 3 comments
Closed

undefinedConnection name for a connection definition #151

excitement-engineer opened this issue Feb 25, 2017 · 3 comments

Comments

@excitement-engineer
Copy link

In my code I have created a connection as follows:

const { connectionType: JokeItemConnection } = connectionDefinitions({
  nodeType: new GraphQLNonNull(GraphQLJoke)
});

export default new GraphQLObjectType({
  name: "User",
  description: "Represents a user of the joke API.",
  fields: () => ({
    //... other fields have been omitted
    jokes: {
      type: new GraphQLNonNull(JokeItemConnection),
      description: "All the user's jokes.",
      args: connectionArgs,
      resolve: (user: User, args, { viewer, loaders }: Context) =>
        connectionFromPromisedArray(
          user.jokes(loaders.joke),
          args
        )
    }
  })
});

Next, when I look in graphiql I see that the name of the connection is undefinedConnection:

screen shot 2017-02-25 at 14 52 05

When I now change the connection definition as follows:

const { connectionType: JokeItemConnection } = connectionDefinitions({
  nodeType: GraphQLJoke
});

Then the name of the connection is correct!

Is this a bug?

@sibelius
Copy link
Contributor

sibelius commented Oct 3, 2017

@excitement-engineer is this still a problem for you?

@excitement-engineer
Copy link
Author

Hey @sibelius! Thanks for reminding me:) I created a PR that fixes this issue, see #177.

@IvanGoncharov
Copy link
Member

fixed in #331

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

3 participants