Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mutation

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Mutation(name: string, request: string, args?: object): Mutation
  • Simple exemple with no data

    Mutation

     let mutation = new Mutation("sign_up", {email: "randommail@mail.fr", password:"secretPassword"});
    
    //But not interest to make that...

    Simple exemple with sample data

     let mutation = new Mutation("sign_up", {email: "randommail@mail.fr", password:"secretPassword"}).get(["pseudo", "id"]);
    
    // mutation.toString() is equal to :
    // mutation {
    //   sign_up(email: "randommail@mail.fr", password:"secretPassword"){
    //       pseudo, id
    //   }
    // }
    

    Query

    Simple exemple with no data

     let query = new Query("login", {email: "randommail@mail.fr", password:"secretPassword"});
    
    //But not interest to make that...

    Simple exemple with sample data

     let query = new Query("login", {email: "randommail@mail.fr", password:"secretPassword"}).get(["pseudo", "id"]);
    
    // query.toString() is equal to :
    // query {
    //   login(email: "randommail@mail.fr", password:"secretPassword"){
    //       pseudo, id
    //   }
    // }

    Parameters

    • name: string

      The name of the query

    • request: string
    • Default value args: object = { ___null: -1 }

      The args of the query by default no value

    Returns Mutation

Properties

Private args

args: any

Private data

data: any

Private name

name: string

Private request

request: string

Private str

str: Str

Methods

get

  • Mutation

    Sample use

     let mutation = new Mutation("sign_up", {email: "randommail@mail.fr", password:"secretPassword"});
     mutation.get(["id", "pseudo", "credits"]);
    
    // mutation.toString() is equal to :
    // mutation {
    //   sign_up(email: "randommail@mail.fr", password:"secretPassword"){
    //       id, pseudo, credits
    //   }
    // }
    

    Some Sample

     let mutation = new Mutation("shop_buy", {ShopUserID: 1});
     let shop = new Mutation("response").get(["isOK", {items: ["name", "price"]}]) // is equal to {response: "isOK"}
     mutation.get(shop);
    
    
    
    // mutation.toString() is equal to :
    // mutation {
    //   shop_buy(ShopUserID: 1){
    //       response{
    //           isOk,
    //           items{
    //               name, price
    //           }
    //       }
    //   }
    // }

    Query

    Sample use

    
     let query = new Query("login", {email: "randommail@mail.fr", password:"secretPassword"});
     query.get(["id", "pseudo", "credits"]);
    
    // query.toString() is equal to :
    // query {
    //   login(email: "randommail@mail.fr", password:"secretPassword"){
    //       id, pseudo, credits
    //   }
    // }
    

    Some Sample

    
     let query = new Query("shop_show", {ShopUserID: 1});
     let shop = new Query("response").get(["shopName", {items: ["name", "price"]}]) // is equal to {response: "isOK"}
     query.get(shop);
    
    // query.toString() is equal to :
    // query {
    //   shop_show(ShopUserID: 1){
    //       response{
    //           shopName,
    //           items{
    //               name, price
    //           }
    //       }
    //   }
    // }

    Parameters

    Returns Mutation

    Return the Mutation instance

toString

  • toString(q?: boolean, args?: any): undefined | String
  • Parameters

    • Default value q: boolean = false

      please dont touch

    • Default value args: any = {}

      please dont touch

    Returns undefined | String

Generated using TypeDoc