Skip to content

infinite query matchFulfilled returns wrong type #4859

Open
@Dirard

Description

@Dirard
// api
getInfinityScrollThreads: build.infiniteQuery<GetPostsResponse, Args, number>

// slice
extraReducers: (builder) => {
    builder.addMatcher(api.endpoints.getInfiniteQueryPosts.matchFulfilled, (state, action) => {
       const payload = action.payload <-- shows up as GetPostsResponse but is actually { pages: GetPostsResponse[], pageParams: number[] }
    }

@markerikson Maybe I'm doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions