Skip to content

Feature request : use t.expose instead of t.field on generated objects #83

@baptistemarchand

Description

@baptistemarchand

Hi,

I'm using this generator to create all my GraphQL objects and it works.
However I want to use a feature in the Pothos Prisma Plugin that works with t.expose and doesn't work with t.field (this one).
So it would be great if the generated code in object.base.ts would use t.expose('myField'), insead of

...
myField: t.field(MyObject_MyField_FieldObject),
...

export const MyObject_MyField_FieldObject = defineFieldObject('MyObject', {
  type: 'String',
  description: undefined,
  nullable: false,
  resolve: parent => String(parent.myField),
})

It would also be a lot less generated code. Any reason why it's not done this way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions