-
Notifications
You must be signed in to change notification settings - Fork 49
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
Server: add wrapper to fetch data from the graph #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments. I think many of them are just popped up cause I'm not sure what the standards are here at Aragon.
Overall: I would probably combine those two TheGraph
classes to a TheGraphServiceClient
. 🤷♂️
@@ -0,0 +1,84 @@ | |||
import { ErrorInvalidNetwork } from '../errors' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how the structure is but we will use I think anyways all of those functions here. This means it will get bundled anyways and we could forward the creation of nice TS classes.
What do you think about creating out of it a value object class?
const network = new Network('mainnet');
console.log(network.chainId);
const network = new Network(netObj);
console.log(network.chainId);
console.log(network.toObject());
> { ... }
Codecov Report
@@ Coverage Diff @@
## master #59 +/- ##
=======================================
Coverage 36.76% 36.76%
=======================================
Files 8 8
Lines 204 204
Branches 30 30
=======================================
Hits 75 75
Misses 129 129 Continue to review full report at Codecov.
|
Reuse the scheme we were using on Connect to have a basic wrapper that only supports query data from the graph.