Skip to content

andreteodoro/graphql-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

graphql-java

Installation

Install Mongo DB:

https://docs.mongodb.com/manual/administration/install-community/

Starting the server:

mvn jetty:run

Opening the application:

open http://localhost:3000/

Interesting Files:

Sample GraphQL Queries

List first 10 links, containing "example":

{
  allLinks(first: 10, filter: {description_contains: "example"}) {
    id
    url
    description
    createdAt
    postedBy {
      id
      name
    }
  }
}

Creates new user:

mutation {
  createUser(
    name: "Radoslav Stankov",
    authProvider: {
      email: { email: "rado@example.com", password: "123456" }
    }
  ) {
    id
    email
    name
  }
}

Creates new user token:

mutation {
  signinUser(email: {email: "rado@example.com", password: "123456"}) {
    token
    user {
      id
      email
      name
    }
  }
}

Creates new link:

mutation {
  createLink(url:"http://example.com", description:"Example") {
    id
    url
    description
    postedBy {
      id
      name
    }
  }
}

Creates new vote:

mutation {
  createVote(linkId:"TGluay0yMQ==") {
    user {
      id
      name
    }
    link {
      id
      url
      description
    }
  }
}

About

GraphQL Java example for How To GraphQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published