常用GraphiQL操作

 

Here’s the table of contents:

  1. GraphiQL
    1. 1
    2. 2

GraphiQL

1

{
  horgByName(name: "li ning") {
    name
    hcode @skip(if: true)
    alias @include(if: false)
  }
}

2

type Person {
  name: ID!
  born: Int
  actedIn: [Movie] @relation(name:"ACTED_IN")
}
type Movie {
  title: ID!
  released: Int
  tagline: String
}
type Query {
    person : [Person]
}
{
  person(first:3) {
    name
    born
    actedIn(first:2) {
      title
    }
  }
}
{
  person(filter: {name_starts_with: "L"}, orderBy: "born_asc", first: 5, offset: 2) {
    name
    born
    actedIn(first: 1) {
      title
    }
  }
}
{
  person(filter: {name_starts_with: "J", born_gte: 1970}, first:2) {
    name
    born
    actedIn(first:1) {
      title
      released
    }
  }
}
person(name:"Joe", age:42) {
   name
}
MATCH (person:Person) WHERE person.name = 'Joe' AND person.age = 42 RETURN person { .name } AS person
type Person {
  name : String
  actedIn: [Movie] @relation(name:"ACTED_IN", direction:OUT)
}
person(name:"Keanu Reeves") {
  name
  actedIn {
    title
  }
}
query {
  jane: person(name:"Jane") { name, age }
  joe: person(name:"Joe") { name, age }
}
query {
  person(orderBy:[name_asc, age_desc]) {
     name
     age
  }
}
MATCH (person:Person)
RETURN person { .name, .age } AS person
ORDER BY person.name ASC, person.age DESC
type Role @relation(name:"ACTED_IN", from:"actor", to:"movie") {
   actor: Person
   movie: Movie
   roles: [String]
}
type Person {
  name: String
  born: Int
  roles: [Role]
}
type Movie {
  title: String
  released: Int
  characters: [Role]
}
person(name:"Keanu Reeves") {
   roles {
      roles
      movie {
        title
      }
   }
}

GraphiQL