Give me a Star 🌟
A Graphql Server for creators and posts with relations build using Graphql & Apollo Server & Express & MongoDB
API requires Node.js v14+ to run.
Clone Install the dependencies and start the production.
cd graphql-CreatorsPosts-server
npm install
npm start or npm run devStart
GraphQL Creator TypeDefs
Creator {
id: ID!
fullname: String!
username: String!
email: String!
password: String!
avatar: String
ip_address: String
user_agent: String
createdAt: GraphQLDateTime
updatedAt: GraphQLDateTime
}
GraphQL Post TypeDefs
Post {
id: ID!
title: String!
image: String!
content: String!
creator: String
createdAt: GraphQLDateTime
updatedAt: GraphQLDateTime
}
GraphQL Queries
Query {
allCreators: [Creator!]!
getCreator(id: ID!): Creator!
allPosts: [Post!]!
getPost(id: ID!): Post!
getPostsByCreator(id: ID!): [Post]
}
GraphQL Mutations
Mutation {
registerCreator(creator: CreatorInput): Creator!
loginCreator(credentials: loginInput): Creator!
updateCreator(id: ID!, updates: CreatorInputUpdate): Creator!
deleteCreator(id: ID!): String!
createPost(post: postInput): Post!
editPost(id: ID!, updates: postInputUpadates): Post!
deletePost(id: ID!): String!
}
MIT