-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing relationship fields with many in Database API find query results #7198
Comments
In const result = await context.prisma.author.findMany({
take: 2,
include: {
posts: {
select: {
id: true,
},
},
},
});
console.log(result[0]); So maybe let expose this Prisma API to Database API too? |
Together with adding const result = await context.db.Author.findMany({
take: 2,
select: {
name: true,
},
include: {
posts: {
select: {
id: true,
},
},
},
}); |
Seems we can simply add keystone/packages/keystone/src/lib/core/queries/resolvers.ts Lines 109 to 110 in 4d7483d
and pass them to runWithPrisma() directly, something like this: #7204Is this right way to implement that? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
examples/blog
project, fill with some data.onConnect
function write two queries:Author
list item theposts
relationship field is missing.But in
Post
theauthor
relationship field is present.Will be good to describe what rule does depend on this, seems it is simple like "only relationships with many = false"?
And what about update functions - can we fill relationships with many=true or not?
So please add this nuance to the documentation here https://keystonejs.com/docs/apis/db-items
And maybe there is some option exists to load item with many relationship fields?
The text was updated successfully, but these errors were encountered: