Prisma plugin : using select instead of include
#1451
Answered
by
hayes
baptistemarchand
asked this question in
Q&A
-
|
I'm using the Prisma plugin. query {
me {
name
posts {
author {
id
}
}
}
}The resulting {
include: {
posts: {
include: {
author: true;
}
}
}
}Is there a way to make it generate something like this ? {
select : {
name : true
posts: {
select: {
author: true;
}
}
}
}So only fetching the necesarry fields, instead of fetching everything? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
hayes
May 14, 2025
Replies: 1 comment 1 reply
-
|
https://pothos-graphql.dev/docs/plugins/prisma/selections#select-mode-for-types |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
baptistemarchand
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://pothos-graphql.dev/docs/plugins/prisma/selections#select-mode-for-types