npm installnpm start- Open browser at http://localhost:3000/graphql
@graphql-tools/schemathis library allows me to easily include custom directives to the schemagraphql-constraint-directivethis library includes custom directives for most common input validations (lenght of string, min, max, etc.)
query posts {
posts(recordsPerPage: 1000000) {
id
title
body
comments{
email
}
}
}
mutation NewPost($post: PostInput!) {
newPost(post: $post) {
title
body
}
}
mutation NewComment($comment: CommentInput!) {
newComment(comment: $comment) {
id
name
body
email
}
}
Variables
{
"post": {
"title": "Long post title",
"body": "body of post"
},
"comment": {
"postId": "63ba25c649e1e48850fe29c2",
"name": "Long comment name",
"email": "prueba@mail.com",
"body": "body of comment"
}
}
Carlos Villacorta