8000 GitHub - andyosyndoh/graphql: A user Interface using graphql to fetch user data for Zone01kisumu
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

andyosyndoh/graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL Profile Page

Objectives

The project fetches user data from Zone 01 kisumu and displays user data in a nice format.

Features

  • User Authentication
    • Login using either username:password or email:password.
    • JWT-based authentication with Bearer token for GraphQL queries.
  • Profile Data Display
    • Basic Identification (ID, login, etc.)
    • XP earned
    • Grades & skills
    • Audit details
  • Graphical Data Visualization
    • XP Progress Over Time
    • Audit Ratio
  • Hosting
    • The project has been hosted on Railway

Setup Instructions

1. Clone the repository

  git https://learn.zone01kisumu.ke/git/aosindo/graphql.git
  cd graphql

Open Live Server

4. Open in Browser

Navigate to http://localhost:port or the hosted URL.

GraphQL Query Examples

Fetch User ID and Login

{
  user {
    id
    login
  }
}

Fetch Skills

{
  skills: transactions(
    where: { type: { _like: "skill_%" } }
    order_by: [{ amount: desc }]
  ) {
    type
    amount
  }
}

Fetch XP Transactions

{
  transaction(
    where: { _and: [{ eventId: { _eq: 75 } }] }
    order_by: { createdAt: desc }
  ) {
    amount
    createdAt
    eventId
    path
    type
    userId
  }
}

Fetch Audit Data

{
  audits(
    order_by: { createdAt: desc }
    where: {
      closedAt: { _is_null: true }
      group: { captain: { canAccessPlatform: { _eq: true } } }
    }
  ) {
    closedAt
    group {
      captain {
        canAccessPlatform
      }
      captainId
      captainLogin
      path
      createdAt
      updatedAt
      members {
        userId
        userLogin
      }
    }
    private {
      code
    }
  }
}

Fetch level

{
  events(where: { eventId: { _eq: 75 } }) {
    level
  }
}

Fetch Grades

{
  progress(
    where: { _and: [{ grade: { _is_null: false } }, { eventId: { _eq: 75 } }] }
    order_by: { createdAt: desc }
  ) {
    id
    createdAt
    eventId
    grade
    path
  }
}

Example Data Format

{
  "data": {
    "transaction": [
      { "type": "xp", "amount": 500 },
      { "type": "xp", "amount": -300 },
      { "type": "xp", "amount": 200 }
    ]
  }
}

About

A user Interface using graphql to fetch user data for Zone01kisumu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0