Welcome to the Distilled API documentation. Our backend is a Ruby GraphQL API that supports the Distilled platform. This API allows you to interact with the platform and perform various tasks, such as creating and managing users and projects. Use the documentation below to learn more about the available API methods and how to use them.
To get started with the Distilled API, you will need to set up a development environment and install the required dependencies. Prerequisites
Before you can start using the Distilled API, you will need to have the following tools installed on your system:
- Ruby 2.7 or higher
- Bundler
- PostgreSQL
To install the required dependencies for the Distilled API, follow these steps:
- Clone the repository:
git clone https://github.com/[user]/distilled-api.git
- Install the dependencies:
cd distilled-api
bundle install
- Start the application
bundle exec rails s -p ${PORT:-3000} -e ${RACK_ENV:-production}
Below is a list of the available API methods, with a brief description and example usage for each.
Creates a new user with the given email, password, and name. Returns the created user.
mutation {
createUser(email: "[email protected]", password: "password123", name: "John Smith") {
id
email
name
}
}
Updates the user with the given ID. Returns the updated user.
mutation {
updateUser(id: 1, email: "[email protected]", password: "password123", name: "John Smith") {
id
email
name
}
}
Deletes the user with the given ID. Returns true if the user was successfully deleted, false otherwise.
mutation {
deleteUser(id: 1)
}
Creates a new project with the given name and user ID. Returns the created project.
mutation {
createProject(name: "My Project", userId: 1) {
id
name
}
}
Updates the project with the given ID. Returns the updated project.
mutation {
updateProject(id: 1, name: "My Updated Project") {
id
name
}
}
Deletes the project with the given ID. Returns true if the project was successfully deleted, false otherwise.
mutation {
deleteProject(id: 1)
}