input MessageInput {
content: String
author: String
}
type Message {
id: ID!
content: String
author: String
}
type Query {
getMessage(id: ID!): Message
}
type Mutation {
createMessage(input: MessageInput): Message
}
Message content can be max length 255. How to document that max length is 255 characters? How/Where to do this validation?
On the server-side, you would validate in the resolver for the
createMessage
mutation.I would also recommend having some sort of client-side validation as well!