Sleep Time

Use sleepTimes query to get the number of total minutes of sleep the user has logged for the given date range.

Required Arguments

Argument

Type

Description

start

Date!

The start date when the steps will be counted. Use the format: YYYY-MM-DD

end

Date!

The end date when the steps will be counted. Use the format: YYYY-MM-DD

first

Int

Retrieves the first results from the list.

after

String

It takes the cursor type and retrieves results after that position.

id

ID

Id of Sleep Time record.

Available Fields

Field Name

Type

Description

dailyGoal

Int!

Daile goal of total sleep time in min.

totalTime

Int!

Total Sleep time on the given dates in min.

hasNextPage

Boolean!

Displays whether there are results in the connection after the current segment.

hasPreviousPage

Boolean!

Displays whether there are results in the connection before the current segment.

date

Date!

Date the user logged Sleep Time YYYY-MM-DD

value

Int!

Total Sleep Time in min.

source

String!

Source of input, default is set to suggestic.

id

ID!

Id of Sleep Time record.

Example

query{
  sleepTimes(start:"2022-08-30" end:"2022-09-02"){
   dailyGoal
   totalTime
    pageInfo{
      hasNextPage
      hasPreviousPage
    }
    edges{
      node{
        date
        source
        value
        id
      }
    }
  }
}

Last updated