This GraphQL API powers the e-commerce application built for the Junior Fullstack position test. The backend is developed with object-oriented PHP without frameworks, hosted securely on x10Hosting with SSL certification. Below you'll find complete documentation for interacting with the API.
Send a POST request to:
https://scandi-market.x10.mx/graphql
Include this header:
Content-Type: application/json
And in the body, send a JSON object with your GraphQL query, for example:
{
"query": "query { products { id name inStock } }"
}
query GetProducts {
products {
id
name
inStock
gallery
description
category {
name
}
attributes {
id
name
type
options {
id
displayValue
value
}
}
prices {
amount
currency {
label
symbol
}
}
brand
}
}
query GetProductById($id: ID!) {
product(id: $id) {
id
name
inStock
gallery
description
category {
name
}
attributes {
id
name
type
options {
id
displayValue
value
}
}
prices {
amount
currency {
label
symbol
}
}
brand
}
}
query GetProductsByCategory($category: String!) {
products(category: $category) {
id
name
inStock
gallery
description
category {
name
}
attributes {
id
name
type
options {
id
displayValue
value
}
}
prices {
amount
formatted
currency {
label
symbol
}
}
brand
}
}
query GetCategories {
categories {
name
}
}
query GetOrders {
orders {
id
total
currency
createdAt
items {
productId
quantity
price
attributes
}
}
}
mutation CreateOrder($input: OrderInput!) {
createOrder(input: $input) {
total
currency
items {
productId
quantity
price
attributes
}
}
}