sikanhe/gqtx

documentation for field arguments is outdated

n1ru4l opened this issue · 2 comments

Is this the correct way?

  t.field("chatMessages", {
    type: t.NonNull(GraphQLChatMessageConnectionType),
    args: {
      first: t.arg(t.Int),
    },
    resolve: (_, args, ctx) => {
      args.first;
      return {
        edges: [],
        pageInfo: { hasNextPage: false },
      };
    },
  }),

I also noticed that the typing of args.first is wrong. It is number but should actually be number | undefined | null.

False alarm, tsconfig was incorrect 😅, still, the readme should be updated.

I created a PR that should fix this problem in the docs.