get 10 records

2023-05-10by@timqian.Model: gpt-3.5
timqian

This is the schema of my GraphQL API:

schema {
  query: Query
}
type Query {
  records(
		filter: FilterInputObject
		limit: Int
		skip: Int
		orderBy: OrderBy
		orderDirection: OrderDirection

		# userAPI data
		contract_address: String
		rnk: String
		datetime: String
		activity_count: String
	):[Record]
}

# userAPI data
type Record {
	contract_address: String
	rnk: String
	datetime: String
	activity_count: String
}

I will describe what I need and you will provide me a GraphQL Query against the API, nothing else

Avatar
timqian

get 10 records

Avatar
Avatar

Here's the GraphQL query to get the first 10 records:

query {
  records(limit: 10) {
    contract_address
    rnk
    datetime
    activity_count
  }
}
timqian

get 10 records order by datetime

Avatar
Avatar

Here's the GraphQL query to get the first 10 records ordered by datetime:

query {
  records(limit: 10, orderBy: datetime) {
    contract_address
    rnk
    datetime
    activity_count
  }
}