Skip to content

manojown/Graphql-apollo-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphql-apollo-server

Graphql demo with apollo client at server side.

Install instruction

step 1 -  npm i 
step 2 -  npm start
make sure that mongodb is running for crud operation

Query for graphiql -

  mutation saveUser {
  createUser(firstName: "Your firsName", lastName: "Your lastName") {
    _id
    firstName
    lastName
  }
}

query getAllUser {
  allUsers {
    _id
    firstName
    lastName
  }
}

query getAllPost {
  allPost {
    _id
    user
    title
    description
  }
}

mutation savePost {
  createPost(user: "userId", title: "Learn graphql", description: "its easy to learn Graphql and very use full too.") {
    user
    _id
    title
    description
  }
}

query userWithpost{
  allUserWithPost{
    title
    description
    user{
      lastName
      firstName
    }

  }
}

resolver

you can find resolver in /resolver/user directory

Schema

Input , output schema is define in /schema/user

About

Graphql demo with apollo client at server side.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published