Giter Site home page Giter Site logo

api's Introduction

Nest API - Rust

A graphql API for the nest.land registry.

Note: Currently only read-only

Usage

Running server

cargo run (or ``cargo watch -x run``)
# Started http server: 127.0.0.1:8080

Web client

http://127.0.0.1:8080/graphiql

Queries

package

{
  package(name: "eggs") {
    name,
    owner,
    normalizedName,
    latestVersion,
    latestStableVersion,
    packageUploadNames
  }
}

Result:

{
  "data": {
    "package": {
      "name": "eggs",
      "owner": "nest.land",
      "normalizedName": "eggs",
      "latestVersion": "v0.1.0",
      "latestStableVersion": "v0.1.0",
      "packageUploadNames": [
        "eggs"
      ]
    }
  }
}

user

{
  user(apiKey: "efc56537a8214c5b9d4320c551790cf3") {
    name,
    normalizedName,
  	createdAt
  }
}
{
  "data": {
    "user": {
      "name": "divy[Divy]",
      "normalizedName": "divy_divy_",
      "createdAt": "2020-06-27T10:15:55.670232Z"
    }
  }
}

Mutations

createUser

mutation {
  createUser(newUser: { name: "divy [Divy]", password: "hehe"}) {
    name
    normalizedName
    apiKey
    packageNames
    createdAt
  }
}

Result:

{
  "data": {
    "createUser": {
      "name": "divy [Divy]",
      "normalizedName": "divy _divy_",
      "apiKey": "efc56537a8214c5b9d4320c551790cf3",
      "createdAt": "2020-06-27T10:15:55.670232Z",
      "packageNames": [
        "autopilot"
      ]
    }
  }
}

createPackage

mutation {
  createPackage(newPackage: {name: "autopilot", normalizedName: "autopilot", owner: "divy", description: "Cross-platform desktop automation", repository: "https://github.com/divy-work/nest-api-rust", latestVersion: "v0.1.0", latestStableVersion: "v0.1.0", packageUploadNames: ["autopilot"], locked: false, malicious: false, unlisted: false, updatedAt: "sometime", createdAt: "sometime"}) {
    name
    owner
    normalizedName
    latestVersion
    latestStableVersion
    packageUploadNames
  }
}

Result:

{
  "data": {
    "createPackage": {
      "name": "autopilot",
      "owner": "autopilot",
      "normalizedName": "autopilot",
      "latestVersion": "v0.1.0",
      "latestStableVersion": "v0.1.0",
      "packageUploadNames": [
        "autopilot"
      ]
    }
  }
}

api's People

Contributors

littledivy avatar

Stargazers

 avatar

Watchers

 avatar  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.