Schema.js

PHOTO EMBED

Tue Nov 22 2022 08:45:17 GMT+0000 (Coordinated Universal Time)

Saved by @DGSH9

const { buildSchema } = require('graphql');

module.exports = buildSchema(`
    type Post{
        _id:ID!
        title:String!
        content:String!
        imageUrl:String!
        creator:User!
        createdAt:String!
        updatedAt:String!
    }    

    type User{
        _id:ID!
        email: String!
        name: String!
        password: String!
        status: String!
        post: [Post!]!

    }    
    input UserInputData{
        email: String!
        name: String!
        password: String!
    }
    type RootMutation{
        createUser(userInput:UserInputData):User!
    }
    type RootQuery{
        hello: String
    }
    schema{
        query: RootQuery
        mutation: RootMutation
    }
`)
content_copyCOPY