Skip to content

Support of objects in connections

Compare
Choose a tag to compare
@NyanKiyoshi NyanKiyoshi released this 01 Aug 08:48
· 50 commits to master since this release

#22 added the support of objects and nested objects inside connection fields.

Allowing to pass objects as arguments, this will parse and pass as arguments (tuple):

['10', {'price': {'gte': '1000'}}]

For example, when implementing filter objects, like this:

input PriceRangeInput {
  gte: Float
  lte: Float
}

input ProductFilterInput {
  price: PriceRangeInput
}

type Query {
  products(filter: ProductFilterInput): ProductCountableConnection
}

Queried like this:

query CategoryProducts($id: ID!) {
  category(id: $id) {
    products(first: 10, filter: {price: {gte: 1000}}) {
      edges {
        node {
          id
        }
      }
    }
  }
}