hey guys, How can i add an extra object to the dat...
# orm-help
k
hey guys, How can i add an extra object to the data object that returned by prisma ? the main purpose is to find out about the existence of next page for pagination, Just like the photo that is attached.
b
Are you using https://nexus.js.org/?
if the answer is yes, you can do this:
Copy code
export const User = prismaObjectType({
  name: 'User',
  definition(t) {
    t.prismaFields({ filter: ['password'] })
    t.field('customField', {
      type: 'CustomType',
      resolve: async (user, _, context) => {
       // do what you want
      },
    })
k
@bkstorm Tnx for reply, No I'm using
graphql-yoga
and
prisma
.