apollo-datasource-mongodb icon indicating copy to clipboard operation
apollo-datasource-mongodb copied to clipboard

findByFields returns a Union of (T | undefined | null)[]

Open tr3ysmith opened this issue 2 years ago • 1 comments

Why does the findByFields() and other functions provided by "this" return a union of the (TData, undefined, and null)[]?

Why not just TData[]?

image

tr3ysmith avatar Apr 20 '22 21:04 tr3ysmith

If this raise a type error with your resolvers typed with graphql-code-generator, I can recommend you this comment.

RemyMachado avatar May 12 '22 19:05 RemyMachado