Skip to content

StephenForrest/distilled-backend

Repository files navigation

Distilled API

Distilled API - Introduction

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.

Getting Started

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

Installation

To install the required dependencies for the Distilled API, follow these steps:

  1. Clone the repository:
git clone https://github.com/[user]/distilled-api.git
  1. Install the dependencies:
cd distilled-api
bundle install
  1. Start the application
bundle exec rails s -p ${PORT:-3000} -e ${RACK_ENV:-production}

API Documentation

Below is a list of the available API methods, with a brief description and example usage for each.

createUser(email: String!, password: String!, name: String!): User

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
  }
}

updateUser(id: ID!, email: String, password: String, name: String): User

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
  }
}

deleteUser(id: ID!): Boolean

Deletes the user with the given ID. Returns true if the user was successfully deleted, false otherwise.

mutation {
  deleteUser(id: 1)
}

createProject(name: String!, userId: ID!): Project

Creates a new project with the given name and user ID. Returns the created project.

mutation {
  createProject(name: "My Project", userId: 1) {
    id
    name
  }
}

updateProject(id: ID!, name: String): Project

Updates the project with the given ID. Returns the updated project.

mutation {
  updateProject(id: 1, name: "My Updated Project") {
    id
    name
  }
}

deleteProject(id: ID!): Boolean

Deletes the project with the given ID. Returns true if the project was successfully deleted, false otherwise.

mutation {
  deleteProject(id: 1)
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •