Skip to content
Ghislain B edited this page Oct 19, 2017 · 25 revisions

The implementation of a GraphQL Service requires a certain structure to follow for Angular-Slickgrid to work correctly (it will fail if your structure is any different than what is shown below).

orderBy

The sorting uses orderBy as per this GitHub Suggestion of a Facebook employee. The query will have a orderBy argument with an array of filter properties:

  • orderBy: array of sorting object (see below)
    • sort: field name to sort
    • direction: a GraphQL enum (server side) that can have 1 of these choices:
      • ASC, DESC

Note: the orderBy order is following the order of how the filter objects were entered in the array.

For example

  users (first: 20, offset: 10, orderBy: [{sort: lastName, direction: ASC}, {sort: firstName, direction: DESC}]) {
    totalCount
    pageInfo {
      hasNextPage
    }
    nodes {
      name
      firstName
      lastName
      gender
    }
  }

Contents

Clone this wiki locally