Rewrite generated resolver


Hi there! I’m trying to rewrite a generated resolver.

Here’s a generated resolver:

const PrismaQueries = prismaObjectType({
name: "Query",
definition(t) {

I’m trying to use that generated resolver, but change the logic for a bit:

export const roomsConnection = queryField('roomsConnection', {
type: 'RoomConnection',
async resolve(_parent, args:any, { prisma }) {
const newReturn = {
  pageInfo: prisma.roomsConnection(args).pageInfo(),
  edges: prisma.roomsConnection(args).edges(),
  aggregate: prisma.roomsConnection(args).aggregate()
return newReturn

The last thing that I need to make work is the args, it requires all args like where, last etc.

Is there a way how can i take these generated args and re-use them? Something like:

import { NexusGenArgTypes } from '../../generated/nexus';
const reusedArgs: NexusGenArgTypes["Query"]["usersConnection"] = {};

Thanks a lot!


hey I have a question, if a content is re-written on a rewriting site. Can I use it on my site without being plagrised? By the way if you are looking for best SMO Service in Australia, visit SMO Services Australia.