-
For example, suppose I'm trying to implement the following as a Nexus schema:
Right now I'm defining the common fields Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Answered by
shreyas44
Jan 21, 2021
Replies: 1 comment 6 replies
-
Hey @carnesen! I don't think there's a built in way to achieve what you're talking about. However, you could try using the below workaround. I haven't tested it, so I'm not sure if it would work or not. const messageDefinition = (t) => {
t.string("content")
t.string("author")
}
const MessageInput = inputObjectType({
name: "MessageInput",
defintion: messageDefinition,
})
const Message = objectType({
name: "Message",
defintion(t) {
t.id("id")
messageDefinition(t)
}
}) |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
carnesen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @carnesen! I don't think there's a built in way to achieve what you're talking about. However, you could try using the below workaround. I haven't tested it, so I'm not sure if it would work or not.