TheSocialPitstop GraphQL API Reference
This is the documentation for TheSocialPitstop's GraphQL API. In this reference, you will find functions that we have used in our website to retrieve information about our users.
API Endpoints
# Endpoint:
https://x2zpvsawy5hatarddisdsrpwva.appsync-api.ap-southeast-1.amazonaws.com/graphql
Queries
getItem
Example
Query
query GetItem(
$user_id: String!,
$item_type: String!
) {
getItem(
user_id: $user_id,
item_type: $item_type
) {
user_id
item_type
name
category
datetime
address
contact_num
email
details
title
content
reviewer_id
reviewer_name
rating
review
follower_id
follower_name
partner_id
partner_name
partner_status
image_url
event_name
event_date
event_location
event_details
needs
}
}
Variables
{
"user_id": "xyz789",
"item_type": "abc123"
}
Response
{
"data": {
"getItem": {
"user_id": "abc123",
"item_type": "abc123",
"name": "xyz789",
"category": "xyz789",
"datetime": AWSDateTime,
"address": "abc123",
"contact_num": AWSPhone,
"email": AWSEmail,
"details": "abc123",
"title": "xyz789",
"content": "abc123",
"reviewer_id": "xyz789",
"reviewer_name": "xyz789",
"rating": 123,
"review": "abc123",
"follower_id": "xyz789",
"follower_name": "abc123",
"partner_id": "abc123",
"partner_name": "xyz789",
"partner_status": "abc123",
"image_url": "abc123",
"event_name": "xyz789",
"event_date": AWSDateTime,
"event_location": "abc123",
"event_details": "abc123",
"needs": AWSJSON
}
}
}
listWithItemType
Response
Returns an
ItemConnection
Example
Query
query ListWithItemType(
$item_type: String!,
$limit: Int,
$nextToken: String
) {
listWithItemType(
item_type: $item_type,
limit: $limit,
nextToken: $nextToken
) {
items {
user_id
item_type
name
category
datetime
address
contact_num
email
details
title
content
reviewer_id
reviewer_name
rating
review
follower_id
follower_name
partner_id
partner_name
partner_status
image_url
event_name
event_date
event_location
event_details
needs
}
nextToken
}
}
Variables
{
"item_type": "abc123",
"limit": 123,
"nextToken": "xyz789"
}
Response
{
"data": {
"listWithItemType": {
"items": [Item],
"nextToken": "abc123"
}
}
}
queryItemWithCategory
Response
Returns an
ItemConnection
Example
Query
query QueryItemWithCategory(
$item_type: String!,
$category: String!,
$first: Int,
$after: String
) {
queryItemWithCategory(
item_type: $item_type,
category: $category,
first: $first,
after: $after
) {
items {
user_id
item_type
name
category
datetime
address
contact_num
email
details
title
content
reviewer_id
reviewer_name
rating
review
follower_id
follower_name
partner_id
partner_name
partner_status
image_url
event_name
event_date
event_location
event_details
needs
}
nextToken
}
}
Variables
{
"item_type": "abc123",
"category": "xyz789",
"first": 987,
"after": "xyz789"
}
Response
{
"data": {
"queryItemWithCategory": {
"items": [Item],
"nextToken": "abc123"
}
}
}
queryItemWithNamePrefix
Response
Returns an
ItemConnection
Example
Query
query QueryItemWithNamePrefix(
$item_type: String!,
$name_prefix: String!,
$limit: Int,
$nextToken: String
) {
queryItemWithNamePrefix(
item_type: $item_type,
name_prefix: $name_prefix,
limit: $limit,
nextToken: $nextToken
) {
items {
user_id
item_type
name
category
datetime
address
contact_num
email
details
title
content
reviewer_id
reviewer_name
rating
review
follower_id
follower_name
partner_id
partner_name
partner_status
image_url
event_name
event_date
event_location
event_details
needs
}
nextToken
}
}
Variables
{
"item_type": "xyz789",
"name_prefix": "abc123",
"limit": 123,
"nextToken": "xyz789"
}
Response
{
"data": {
"queryItemWithNamePrefix": {
"items": [Item],
"nextToken": "xyz789"
}
}
}
queryUserWithItemTypePrefix
Response
Returns an
ItemConnection
Example
Query
query QueryUserWithItemTypePrefix(
$user_id: String!,
$item_type_prefix: String!,
$limit: Int,
$nextToken: String
) {
queryUserWithItemTypePrefix(
user_id: $user_id,
item_type_prefix: $item_type_prefix,
limit: $limit,
nextToken: $nextToken
) {
items {
user_id
item_type
name
category
datetime
address
contact_num
email
details
title
content
reviewer_id
reviewer_name
rating
review
follower_id
follower_name
partner_id
partner_name
partner_status
image_url
event_name
event_date
event_location
event_details
needs
}
nextToken
}
}
Variables
{
"user_id": "xyz789",
"item_type_prefix": "abc123",
"limit": 123,
"nextToken": "abc123"
}
Response
{
"data": {
"queryUserWithItemTypePrefix": {
"items": [Item],
"nextToken": "xyz789"
}
}
}
Mutations
createItem
Response
Returns an
Item
Arguments
Name | Description |
---|---|
input -
ItemInput!
|
Example
Query
mutation CreateItem($input: ItemInput!) {
createItem(input: $input) {
user_id
item_type
name
category
datetime
address
contact_num
email
details
title
content
reviewer_id
reviewer_name
rating
review
follower_id
follower_name
partner_id
partner_name
partner_status
image_url
event_name
event_date
event_location
event_details
needs
}
}
Variables
{"input": ItemInput}
Response
{
"data": {
"createItem": {
"user_id": "xyz789",
"item_type": "xyz789",
"name": "xyz789",
"category": "xyz789",
"datetime": AWSDateTime,
"address": "xyz789",
"contact_num": AWSPhone,
"email": AWSEmail,
"details": "xyz789",
"title": "xyz789",
"content": "abc123",
"reviewer_id": "abc123",
"reviewer_name": "xyz789",
"rating": 123,
"review": "abc123",
"follower_id": "xyz789",
"follower_name": "abc123",
"partner_id": "abc123",
"partner_name": "abc123",
"partner_status": "xyz789",
"image_url": "abc123",
"event_name": "xyz789",
"event_date": AWSDateTime,
"event_location": "xyz789",
"event_details": "xyz789",
"needs": AWSJSON
}
}
}
deleteItem
Response
Returns an
Item
Arguments
Name | Description |
---|---|
input -
DeleteItemInput!
|
Example
Query
mutation DeleteItem($input: DeleteItemInput!) {
deleteItem(input: $input) {
user_id
item_type
name
category
datetime
address
contact_num
email
details
title
content
reviewer_id
reviewer_name
rating
review
follower_id
follower_name
partner_id
partner_name
partner_status
image_url
event_name
event_date
event_location
event_details
needs
}
}
Variables
{"input": DeleteItemInput}
Response
{
"data": {
"deleteItem": {
"user_id": "abc123",
"item_type": "xyz789",
"name": "xyz789",
"category": "xyz789",
"datetime": AWSDateTime,
"address": "xyz789",
"contact_num": AWSPhone,
"email": AWSEmail,
"details": "abc123",
"title": "abc123",
"content": "abc123",
"reviewer_id": "abc123",
"reviewer_name": "abc123",
"rating": 987,
"review": "xyz789",
"follower_id": "abc123",
"follower_name": "abc123",
"partner_id": "abc123",
"partner_name": "abc123",
"partner_status": "xyz789",
"image_url": "abc123",
"event_name": "xyz789",
"event_date": AWSDateTime,
"event_location": "xyz789",
"event_details": "xyz789",
"needs": AWSJSON
}
}
}
updateItem
Response
Returns an
Item
Arguments
Name | Description |
---|---|
input -
ItemInput!
|
Example
Query
mutation UpdateItem($input: ItemInput!) {
updateItem(input: $input) {
user_id
item_type
name
category
datetime
address
contact_num
email
details
title
content
reviewer_id
reviewer_name
rating
review
follower_id
follower_name
partner_id
partner_name
partner_status
image_url
event_name
event_date
event_location
event_details
needs
}
}
Variables
{"input": ItemInput}
Response
{
"data": {
"updateItem": {
"user_id": "xyz789",
"item_type": "xyz789",
"name": "abc123",
"category": "xyz789",
"datetime": AWSDateTime,
"address": "abc123",
"contact_num": AWSPhone,
"email": AWSEmail,
"details": "xyz789",
"title": "abc123",
"content": "abc123",
"reviewer_id": "abc123",
"reviewer_name": "xyz789",
"rating": 987,
"review": "abc123",
"follower_id": "abc123",
"follower_name": "xyz789",
"partner_id": "xyz789",
"partner_name": "xyz789",
"partner_status": "xyz789",
"image_url": "abc123",
"event_name": "abc123",
"event_date": AWSDateTime,
"event_location": "xyz789",
"event_details": "xyz789",
"needs": AWSJSON
}
}
}
Types
AWSDateTime
Description
The AWSDateTime
scalar type provided by AWS AppSync, represents a valid
extended
ISO 8601 DateTime string. In other words, this scalar type accepts datetime strings of the form YYYY-MM-DDThh:mm:ss.SSSZ
. The scalar can also accept "negative years" of the form -YYYY
which correspond to years before 0000
. For example, "
-2017-01-01T00:00Z" and "
-9999-01-01T00:00Z" are both valid datetime strings. The field after the two digit seconds field is a nanoseconds field. It can accept between 1 and 9 digits. So, for example, "
1970-01-01T12:00:00.2Z", "
1970-01-01T12:00:00.277Z" and "
1970-01-01T12:00:00.123456789Z" are all valid datetime strings. The seconds and nanoseconds fields are optional (the seconds field must be specified if the nanoseconds field is to be used). The
time zone offset is compulsory for this scalar. The time zone offset must either be Z
(representing the UTC time zone) or be in the format ±hh:mm:ss
. The seconds field in the timezone offset will be considered valid even though it is not part of the ISO 8601 standard.
Example
AWSDateTime
AWSEmail
Description
The AWSEmail
scalar type provided by AWS AppSync, represents an Email address string that complies with
RFC 822. For example, "
username@example.com
" is a valid Email address.
Example
AWSEmail
AWSJSON
Description
The AWSJSON
scalar type provided by AWS AppSync, represents a JSON string that complies with
RFC 8259. Maps like "
{\"upvotes\": 10}", lists like "
[1,2,3]", and scalar values like "
\"AWSJSON example string\"", "
1", and "
true" are accepted as valid JSON and will automatically be parsed and loaded in the resolver mapping templates as Maps, Lists, or Scalar values rather than as the literal input strings. Invalid JSON strings like "
{a: 1}", "
{'a': 1}" and "
Unquoted string" will throw GraphQL validation errors.
Example
AWSJSON
AWSPhone
Description
The AWSPhone
scalar type provided by AWS AppSync, represents a valid Phone Number. Phone numbers are serialized and deserialized as Strings. Segments of the phone number may be whitespace delimited or hyphenated. The number can specify a country code at the beginning. However, United States numbers without country codes are still considered to be valid.
Example
AWSPhone
Boolean
Description
Built-in Boolean
DeleteItemInput
Int
Description
Built-in Int
Example
123
Item
Fields
Field Name | Description |
---|---|
user_id -
String!
|
|
item_type -
String!
|
|
name -
String
|
|
category -
String
|
|
datetime -
AWSDateTime
|
|
address -
String!
|
|
contact_num -
AWSPhone
|
|
email -
AWSEmail
|
|
details -
String
|
|
title -
String
|
|
content -
String
|
|
reviewer_id -
String
|
|
reviewer_name -
String
|
|
rating -
Int
|
|
review -
String
|
|
follower_id -
String
|
|
follower_name -
String
|
|
partner_id -
String
|
|
partner_name -
String
|
|
partner_status -
String
|
|
image_url -
String
|
|
event_name -
String
|
|
event_date -
AWSDateTime
|
|
event_location -
String
|
|
event_details -
String
|
|
needs -
AWSJSON
|
Example
{
"user_id": "xyz789",
"item_type": "xyz789",
"name": "abc123",
"category": "xyz789",
"datetime": AWSDateTime,
"address": "abc123",
"contact_num": AWSPhone,
"email": AWSEmail,
"details": "abc123",
"title": "xyz789",
"content": "abc123",
"reviewer_id": "abc123",
"reviewer_name": "xyz789",
"rating": 987,
"review": "abc123",
"follower_id": "abc123",
"follower_name": "abc123",
"partner_id": "abc123",
"partner_name": "abc123",
"partner_status": "abc123",
"image_url": "abc123",
"event_name": "xyz789",
"event_date": AWSDateTime,
"event_location": "abc123",
"event_details": "abc123",
"needs": AWSJSON
}
ItemConnection
ItemInput
Fields
Input Field | Description |
---|---|
user_id -
String!
|
|
item_type -
String!
|
|
name -
String
|
|
category -
String
|
|
datetime -
AWSDateTime
|
|
address -
String
|
|
contact_num -
AWSPhone
|
|
email -
AWSEmail
|
|
details -
String
|
|
title -
String
|
|
content -
String
|
|
reviewer_id -
String
|
|
reviewer_name -
String
|
|
rating -
Int
|
|
review -
String
|
|
follower_id -
String
|
|
follower_name -
String
|
|
partner_id -
String
|
|
partner_name -
String
|
|
partner_status -
String
|
|
image_url -
String
|
|
event_name -
String
|
|
event_date -
AWSDateTime
|
|
event_location -
String
|
|
event_details -
String
|
|
needs -
AWSJSON
|
Example
{
"user_id": "xyz789",
"item_type": "abc123",
"name": "abc123",
"category": "xyz789",
"datetime": AWSDateTime,
"address": "xyz789",
"contact_num": AWSPhone,
"email": AWSEmail,
"details": "xyz789",
"title": "xyz789",
"content": "abc123",
"reviewer_id": "xyz789",
"reviewer_name": "abc123",
"rating": 987,
"review": "xyz789",
"follower_id": "xyz789",
"follower_name": "abc123",
"partner_id": "xyz789",
"partner_name": "abc123",
"partner_status": "xyz789",
"image_url": "xyz789",
"event_name": "xyz789",
"event_date": AWSDateTime,
"event_location": "abc123",
"event_details": "xyz789",
"needs": AWSJSON
}
String
Description
Built-in String
Example
"xyz789"