Git Product home page Git Product logo

java-graphql's Introduction

Java GraphQL

Queries

# ----------------------------------------------------
# Filtering query.
# ----------------------------------------------------
query links {
  allLinks(filter:{description_contains:"back", url_contains:"cool"}) {
    description
    url
  }
}

# ----------------------------------------------------
# Pagination queries.
# ----------------------------------------------------
{
  allLinks(skip:1, first:1) {
    url
    description
  }
}

{
  allLinks(first: 2) {
    url
    description
  }
}

# ----------------------------------------------------
# Error handling queries.
# ----------------------------------------------------
query links {
  allLinks{
    description
    address
  }
}

mutation signin {
  signinUser(auth:{
    email:"[email protected]"
    password:"wrong"
  }) {
    token
  }
}

# ----------------------------------------------------
# Mutation queries, post in REST.
# ----------------------------------------------------
mutation createLink {
  createLink(url: "https://eidmonetagaca.com", description: "My website") {
    url
    description
  }
}

mutation {
  createUser (
    name: "Bojack Horseman"
    authProvider: {
      email: "[email protected]"
      password: "secret"
    }
  ) {
    id
    name
  }
}

mutation link {
  createLink(url:"https://en.wikipedia.org/wiki/Bojack_Horseman", description:"Bojack's Wiki entry") {
    url
  }
}

mutation vote {
  createVote(linkId: "6580ff26430c771859155056", userId:"6580e77bc48dc532b5db34af") {
    createdAt
		link {
      url
    }
    user {
      name
    }
  }
}

Sign in user payload.
mutation signIn {
  signinUser(auth:{email:"[email protected]", password:"secret"}) {
    token
    user {
      id
      name
    }
  }
}

# ----------------------------------------------------
# Query listing.
# ----------------------------------------------------

{
  allLinks {
    url
    description
  }
}

query links {
  allLinks {
    url
    description
  }
}

query all {
  allLinks {
    id
    url
    description
    postedBy {
      name
    }
  }
}

java-graphql's People

Contributors

tagaca19e avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.