0

Network response:

screenshot 2018-12-09 at 13 11 53

Vue instance:

screenshot 2018-12-09 at 13 13 07

Expected network response would be that the all_members would show all (in my case 12) club_members. If I query without using first/skip, it shows only 10 club_members (which is incorrect)

I currently have found a workaround with letting data.totalClubMembers.club_members override the data.club.all_members. Related discussion here: https://github.com/Akryum/vue-apollo/issues/196

(A part of) the query with arguments: $where: 1, $first: 10, $skip: 0.

  query club($where: ClubWhereUniqueInput!, $first: Int, $skip: Int){
    club: club(where: $where){
      name
      all_members: club_members {
        id
      }
      club_members: club_members(first: $first, skip: $skip) {
        id
        category
        club_reference_id
        valid_from
        valid_to
      }
    }
    totalClubMembers: club(where: $where){
      club_members {
        id
      }
    }
  }

Please advise:

  1. if/where I made a mistake
  2. if there is a more "optimal" solution.
Robert
  • 504
  • 5
  • 27

1 Answers1

0

Only root aliases seem to work for now (dec. 2018): https://github.com/prisma/graphql-yoga/issues/340

Refactor into 2 graphql queries will solve it.

Robert
  • 504
  • 5
  • 27