20 lines
326 B
JavaScript
20 lines
326 B
JavaScript
import { gql } from 'apollo-server-micro'
|
|
|
|
export default gql`
|
|
extend type Query {
|
|
messages: [Message!]!
|
|
message(id: ID!): Message!
|
|
}
|
|
|
|
extend type Mutation {
|
|
createMessage(text: String!): Message!
|
|
deleteMessage(id: ID!): Boolean!
|
|
}
|
|
|
|
type Message {
|
|
id: ID!
|
|
text: String!
|
|
user: User!
|
|
}
|
|
`
|