Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mockdata service (tbd) to graph #441

Open
1 of 8 tasks
Tracked by #440
2075 opened this issue Oct 4, 2022 · 0 comments
Open
1 of 8 tasks
Tracked by #440

add mockdata service (tbd) to graph #441

2075 opened this issue Oct 4, 2022 · 0 comments

Comments

@2075
Copy link
Member

2075 commented Oct 4, 2022

Shape

range {
    start: block -> optional, then elements is a divisor
    end: block -> optional, default: current block
    unit: enum: "day", "week", "month", "months", "year" -> default: "day"
    elements: int -> default: 1000
    filter: total, transferrable, reserved, locked -> default: total
    fx: usd, eur -> optional, returns converted, otherwise original currency
}
fx ( input: string, output: string, qty: float, range: object )
 zeroausd -> [0.1,0.2,0.3,0.4,0.9,1.9,10.9,100,200,900,1337]
 gameausd
 playausd -> [1]
 zerodot
 gamedot
 zeroksm
 gameksm
treasury ( where: { id: <0xb00b5> } )
  mock: boolean -> return true when no real data available
  balances ( currency: string, range: object )
    returns -> [0.1,0.2,0.3,0.4,0.9,1.9,10.9,100,200,900,1337]
  events ( currency: string, range: object )
    returns -> [ { block, event_type } , ... , { block, event_type } ]
events [ { block, event_type }]
  block: int
  event_type: 
    create, 
    donation, funding,
    withdrawal, spending,
    join, leave,
    lock, unlock, reserve, unreserve,
    unknown
    ...
  schema,
  query -> e.g. query avg blocktime
  mutation
  subscription -> get the last block 

1.

  • decide if apollo mock or custom resolver
  • add resolver to provide date ranges based on respective blocktime
  • define schema required in the frontend

2.

  • build resolver sending static data
  • build resolver sending dynamic data

3.

  • add mock resolver returning data for treasury to dev
  • add mock resolver to stage
  • add mock resolver returning errors to prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants