Skip to content

v5tech/graphql-spqr-samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL SPQR Spring Boot Samples

Package with maven, run the jar, play around.

Out of the box it runs on port 7777

Graphiql tool is mapped to root (e.g. http://localhost:7777/)

API is exposed on /graphql

  • Spring Boot SPQRR Sample

http://localhost:7777

{
  getNormalGreeting(person: {firstName: "si", lastName: "li"})
}
{
  getPoliteGreeting(customer: {firstName: "san", lastName: "li", title: MR})
}
{
  getProductsInStock(vendorId: 2) {
    product {
      name
      description
    }
    stockSize
  }
}
{
  firstNPersons(count: 5) {
    firstName
    lastName
    socialNetworkAccounts {
      networkName
      username
      numberOfConnections
    }
  }
}
  • Spring Boot SPQR Starter Sample

http://localhost:8989/graphiql

mutation {
  createProject(name: "spring boot", tags: ["java"]) {
    code
    name
    done
    tags
    issues {
      code
      description
      status
    }
  }
}
mutation {
  createIssue(projectCode: "BPR", description: "spring boot description", status: DONE) {
    code
    description
    project {
      name
      tags
      done
      code
    }
    status
  }
}
{
  project(code: "BPR") {
    code
    done
    name
    tags
    issues {
      code
      description
      status
      project {
        code
        name
        tags
      }
    }
  }
}