hettlage (133) [Avatar] Offline
#1
The type definitions in Section 3.3 (Circular References) contains args fields in places where I suspect they might not be necessary. For example,

const linkType = new GraphQLObjectType({
  name: 'Link',
  fields: () => ({
    id: { type: GraphQLInt },
    url: { type: GraphQLString },
    description: { type: GraphQLString },
    author: {
      type: userType,
      args: {
        author: { type: GraphQLInt },
      },
      resolve: ({ author }) => find(users, { id: author }),
    },
    comments: {
      type: new GraphQLList(commentsType),
      resolve: ({ comments }) => comments.map(i => find(commentsList, { id: i })),
    },
  }),
});


probably can be simplified to

const linkType = new GraphQLObjectType({
  name: 'Link',
  fields: () => ({
    id: { type: GraphQLInt },
    url: { type: GraphQLString },
    description: { type: GraphQLString },
    author: {
      type: userType,
      resolve: ({ author }) => find(users, { id: author }),
    },
    comments: {
      type: new GraphQLList(commentsType),
      resolve: ({ comments }) => comments.map(i => find(commentsList, { id: i })),
    },
  }),
});


Similarly, the arguments of some of the resolvers might be incorrect.