Giter Site home page Giter Site logo

apmoola's Introduction

apmoola

A rockin GraphQL API


Setup

  1. Fork and clone the repo
  2. Navigate to the locally cloned repo directory and install dependencies
npm install
  1. Run the server locally via start script
npm start
  1. visit http://localhost:4000/ to open GraphQL Playground and run queries on your locally hosted GraphQL API

    -- or --

    Call the API using your favorite tool

Curl Example

curl \
-X POST \
-H "Content-Type: application/json" \
--data '{"query": "{ apps { name events { name }}}"}' \
http://localhost:4000/

Other methods can be found here


Schema

# start and end arguments for events are not required
# if passed in, events will be filtered to include only those
# that fall within the start and end dates (inclusive)
# Format of start and end values needs to be in milliseconds since Unix Epoch

type App {
  id: ID!
  name: String!
  events(start: Int, end: Int): [Event!]!
  stages: [Stage!]!
}

type Stage {
  id: ID!
  name: String!
  events(start: Int, end: Int): [Event!]!
}

type Event {
  id: ID!
  appId: ID!
  stageId: ID!
  name: String!
  description: String!
  image: String!
  startsAt: Int!
  endsAt: Int!
  stage: Stage!
}

type Query {
  apps: [App!]!
  stages: [Stage!]!
  events(start: Int, end: Int): [Event!]!

  app(id: ID, name: String): App!
  stage(id: ID, name: String): Stage!
  event(id: ID, name: String): Event!
}

type Mutation {
  addStage(name: String!): Stage

  # id value will determine which stage is being updated
  updateStage(id: ID!, name: String): Stage

  # either id or name value can be used to find the stage to be removed
  removeStage(id: ID, name: String): Stage

  addEvent(appId: ID!, stageId: ID!, name: String!, description: String!, image: String!, startsAt: Int!, endsAt: Int!): Event

  # id value will determine which event is being updated
  updateEvent(id: ID!, appId: ID, stageId: ID, name: String, description: String, image: String, startsAt: Int, endsAt: Int): Event

  removeEvent(id: ID!): Event
}

Supports

  • Listing

    • Apps
    • Stages
    • Events
    • Events in an app
    • Stages in an app
    • Events at a stage
    • Stage for an event
    • Events that occur between two dates
  • Querying a single

    • App
    • Stage
    • Event
  • Searching by name

    • Apps
    • Stages
    • Events
  • Adding, updating, and removing

    • Stages
    • Events

TODO

  • Write unit tests
  • Persist data on a database

apmoola's People

Contributors

7mimira avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.