documentation for field arguments is outdated
n1ru4l opened this issue · 2 comments
n1ru4l commented
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
.
n1ru4l commented
False alarm, tsconfig was incorrect 😅, still, the readme should be updated.
FedericoBiccheddu commented
I created a PR that should fix this problem in the docs.