Skip to content

Snippets

GraphQL

https://www.graphile.org/postgraphile/examples/

Basic query

{allNe10MAdmin0Countries{nodes{name}}}

Retrieve schema details (list types)

{
  __schema {
    types {
      name
      kind
      fields {
        name
      }
    }
  }
}

Retrieve details for type

{
  __type(name: "Query") {
    name
    kind
    description
    fields {
      name
    }
  }
}

Retrieve objects with specified fields

{
  allNe10MAdmin0Countries {
    edges {
      node {
        id
        name
      }
    }
  }
}

Named query

query getCountries {
  allNe10MAdmin0Countries {
    nodes {
      id
      name
    }
  }
}

Retrieve item by id

{
  ne10MAdmin0CountryById (id: 6) {
    name
  }
}

Retrieve object with conditional filter

{
  allNe10MAdmin0Countries(condition: {name: "Argentina"}) {
    edges {
      node {
        id
        sovereignt
        name
      }
    }
  }
}
Back to top