Prisma-client: Field 'experiencesConnection' of type 'ExperienceConnection' must have a sub selection

prisma

#1

I’m using prisma-client to try and make a pagination but am not sure how to go on with the resolver:

export const experiences = async (
  parent,
  args: { language: "es" | "en"; currency: "USD" },
  ctx: Context
) => {
  try {
    const res = await ctx.db.experiencesConnection({
      where: {
        translation: {
          language: {
            slug: args.language
          }
        },
        price: {
          currency: {
            slug: args.currency
          }
        }
      }
    });
    return res;
  } catch (err) {
    console.error("ERROR: ", err);
    return err;
  }
};

schema.graphql

#import ExperienceConnection from './generated/prisma/prisma.graphql'

type Query {
  experiences(language: String!, currency: String!): ExperienceConnection
}

But when running it in the playground I get:

What am I doing wrong?


Building resolvers for linksConnection query and other nested relations
#2

This is a current limitation or Prisma Client, which is documented and explained here: https://github.com/prisma/prisma/issues/3309. We’re currently discussing possible solutions.


#3

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.