DEV Community

Discussion on: I Migrated Away from Apollo Client to Vercel SWR and Prisma graphql-request...and You Can Too!

Collapse
 
naveen_bharathi_a55cc4187 profile image
Naveen Bharathi

Hi @hongducphan ,
You passed 'first' instead of 'skip' in the fetcher function. That is the problem. Renaming it should fix the issue.

query allProducts($skip: String!, $take: String!) {
                   ̅ ̅ ̅ ̅ ̅ 
  allProducts(skip: $skip, take: $take) {
    id
    name
  }
}
Enter fullscreen mode Exit fullscreen mode
const fetcher = (query: any, first: string, take: string) => request('localhost:3000/api/graphql', query, { first, take });
                                                                                                             ̅ ̅ ̅ ̅ ̅
Enter fullscreen mode Exit fullscreen mode