✖ Valid values for the strategy argument of `@scalarList` are: RELATION

prisma

#1

I’ve been trying to write this simple schema, which on older versions of prisma would simply work:

type Project {
  id: ID! @id
  category: ProjectCategory!
  tags: [ProjectTag]
  name: String
  slug: String
  photos: [String]
  media: String
  description: String
}

type ProjectCategory {
  id: ID! @id
  name: String
  slug: String
  photos: [String]
  media: String
  description: String
  projects: [Project!]!
}

type ProjectTag {
  id: ID! @id
  name: String
  slug: String
  photos: [String]
  media: String
  description: String
  projects: [Project]
}

I’ve tried adding @scalarList(strategy:RELATION) to all relations, and also a few different relation directives; but no matter what happens I always get this error on deploy:

Valid values for the strategy argument of@scalarListare: RELATION.

Prisma used to be very simple and intuitive, but it’s been very hard to figure this problem out. Anyone have any examples on how to do this? The ones in the documentation don’t seem to work.


#2

Have you tried @scalarList(strategy: RELATION) on every [String]?

Like this:

type Project {
  id: ID! @id
  category: ProjectCategory!
  tags: [ProjectTag]
  name: String
  slug: String
  photos: [String] @scalarList(strategy: RELATION)
  media: String
  description: String
}

type ProjectCategory {
  id: ID! @id
  name: String
  slug: String
  photos: [String] @scalarList(strategy: RELATION)
  media: String
  description: String
  projects: [Project!]!
}

type ProjectTag {
  id: ID! @id
  name: String
  slug: String
  photos: [String] @scalarList(strategy: RELATION)
  media: String
  description: String
  projects: [Project]
}

#3

That did it… couldn’t figure that’s what it was asking. The docs aren’t clear at all about it.

But thanks @MartenW


#4

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