/higharc

Primary LanguageTypeScript

Higharc Smoothie API

Description of the API

Table of Contents

Query

Field Argument Type Description
user User!

Get the user for the passed authentication token

login String!

Get a valid auth token if user/password is correct

data LoginInput!

Email and password of the user you are logging in as

smoothie Smoothie

Get a smoothie you created by its name

name String!

Name of one of your smoothies you want to find

smoothies [Smoothie!]

Get all smoothies you made

ingredient Ingredient

Get the ingredient by ID

id String!

ID of the ingredient you want to get

Mutation

Field Argument Type Description
signup String!

Create a new user and returns a valid login token

data SignupInput!

Data for the user you are trying to create

deleteRecipe Boolean!

Delete a smoothie you created by its name

name String!

Name of the smoothie you want to delete

modifyRecipe Smoothie!

Update the name of one of your smoothies

name String!

New name of the recipe

recipeName String!

Name of the recipe you want to update

addRecipe Smoothie!

Create a new smoothie

data SmoothieInput!

Input data for the new recipe you are creating

updateIngredient Ingredient!

Update the ingredient by its ID

updates IngredientUpdateInput!

Updates to the ingredient

id String!

ID of the ingredient you want to update

deleteIngredient Boolean!

Delete the ingredient

id String!

ID of the ingredient you want to delete

Objects

Ingredient

Field Argument Type Description
id ID!

Unique identifier of the ingredient

name String!

Name of the ingredient

quantity Float!

How many of the ingredient for recipe

unit IngredientUnits!

Units for the quantity of the ingredient

createdAt DateTime!

Date Created

updatedAt DateTime!

Date Last Updated

Smoothie

Field Argument Type Description
id ID!

Unique identifier of the recipe

name String!

Name of the recipe (must be longer than 3 characters)

createdAt DateTime!

Date Created

updatedAt DateTime!

Date Last Updated

ingredients [Ingredient!]

User

Field Argument Type Description
id ID!

Unique identifier of the User

firstName String

Users first name

lastName String

Users last name

email String!

Users email address

isAdmin Boolean!

Users role (only admin exists)

createdAt DateTime!

Date Created

updatedAt DateTime!

Date Last Updated

smoothies [Smoothie!]!

Inputs

IngredientInput

Field Type Description
name String!

Name of the new ingredient

quantity Float!

Quantity of the new ingredient

unit IngredientUnits!

Unit of the ingredients quantity

IngredientUpdateInput

Field Type Description
name String

New name of the ingredient

quantity Float

New quantity of the ingredient

unit IngredientUnits

New unit of the ingredients quantity

LoginInput

Field Type Description
email String!

Users email address

password String!

Users password (must be greater than 6 characters)

SignupInput

Field Type Description
email String!

Users email address

password String!

Users password (must be greater than 6 characters)

firstName String

Users first name

lastName String

Users last name

isAdmin Boolean

Flag to create an admin user

SmoothieInput

Field Type Description
name String!

Name of your smoothie

ingredients [IngredientInput!]

All ingredients for this Smoothie

Enums

IngredientUnits

Possible Units for a ingredient

Value Description
CUP
PINCH
GRAM
OUNCE

Scalars

Boolean

The Boolean scalar type represents true or false.

DateTime

The javascript Date as string. Type represents date and time as the ISO Date string.

Float

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

ID

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.