Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
uniswapdaydatasbydata query corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammad-Mubeen committed Nov 17, 2021
1 parent 5235ccf commit 0b33c92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions graphql/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -939,11 +939,11 @@ const uniswapdaydatasbydate = {
args: {
first: { type: GraphQLInt },
skip: { type: GraphQLInt },
date: { type: GraphQLInt },
date: { type: GraphQLString },
},
async resolve(parent, args, context) {
try {
let uniswapdaydatas = await UniswapDayData.find({date:args.date});
let uniswapdaydatas = await UniswapDayData.find({date:parseFloat(args.date)});

return uniswapdaydatas.splice(0, args.first);
} catch (error) {
Expand Down
5 changes: 3 additions & 2 deletions graphql/types/uniswapDayData.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const {
GraphQLObjectType,
GraphQLID,
GraphQLString,
GraphQLInt
GraphQLInt,
GraphQLFloat
} = require("graphql");

const uniswapDayDataType = new GraphQLObjectType({
Expand All @@ -13,7 +14,7 @@ const uniswapDayDataType = new GraphQLObjectType({

_id: {type: GraphQLID },
id:{type:GraphQLString},// timestamp rounded to current day by dividing by 86400
date: {type:GraphQLInt},
date: {type:GraphQLFloat},
dailyVolumeETH: {type:GraphQLInt},
dailyVolumeUSD: {type:GraphQLInt},
dailyVolumeUntracked: {type:GraphQLInt},
Expand Down

0 comments on commit 0b33c92

Please sign in to comment.