Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are three main variables that are common across most FlexDeploy GraphQL queries: where, sort, and page.

Variable Name

Description

Object Definition

where: [WhereInput]

This allows you to filter the data like a where clause in an SQL query. Where is an array so multiple individual WhereInput objects can be linked together to filter the query.

field: Name of the GraphQL field being filtered

type: The comparison being performed

  • eq - equal

  • ne - not equal

  • eqi - equal (Ignores Case)

  • gt - greater than

  • lt - less than

  • inc - includes

  • inci - includes (Ignores Case)

  • ninc - does not include

  • empty - empty

  • nempty - not empty

innerWhere: Similar to a subselect in SQL where prefiltering of a query could be done

value: The value you are filtering by

Code Block
languagejson
input WhereInput {
  field: String!
  type: WhereTypeEnum!
  innerWhere: [WhereInput!]
  value: String
}

enum WhereTypeEnum {
  eq
  ne
  eqi
  gt
  lt
  inc
  inci
  ninc
  empty
  nempty
}

sort: [SortInput]

This allows you to sort the data like a order by clause in an SQL query. Sort is an array so multiple individual SortInput objects can be linked together to sort the query.

field: GraphQL field being sorted

direction: the direction of sort being preformed with asc meaning ascending order and desc meaning descending order.

Code Block
languagejson
input SortInput {
  field: String!
  direction: SortEnum
}

enum SortEnum {
  asc
  desc
}

page: PageInput

Page input contains extra options for the block of data that is returned by the query.

limit: The number of items in the block being returned. By default, a limit of 50 items are returned by the query. This can be overridden by the page limit to return a different amount of items.

offset: Offsets the block of data being returned by the set value. For example, a limit of 20 and an offset of 4 would return items 4 through 23.

Code Block
languagejson
input PageInput {
  limit: Int
  offset: Int
}

All of the above variables objects are then bundled together in one variable object. It is not required to always include all three variables in the object. For example, if you wanted to only filter and not sort, you would only need to include the where variable. Below is an example of the combined variable object with all three variables used.

...

Here are are few more examples of GraphQL queries. See Fetching Schema and Introspection for information on how to get our schema for a full listing of available queries and mutations.

...