Skip to content

[Question] How to describe fields or resolvers by dividing it #898

Answered by hayes
touyu asked this question in Q&A
Discussion options

You must be logged in to vote

You can use builder.prismaObjectField(s) to add more fields to an existing type.

Eg:

const Article = builder.prismaNode('Article', {
  ...
});

builder.prismaObjectFields(Article, (t) => ({
  title: t.exposeString('title', { nullable: true }),
}))

builder.prismaObjectField(Article, 'title', (t) => t.exposeString('title', { nullable: true }))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@touyu
Comment options

Answer selected by touyu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #897 on May 03, 2023 17:08.