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

Commit

Permalink
PAIR DATA query corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammad-Mubeen committed Nov 15, 2021
1 parent b5f3478 commit 4fd6f5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions graphql/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@ const allpairs = {
};

const pairbyId = {
type: pairType,
type: GraphQLList(pairType),
description: "Retrieves pair against id",
args: {
id: { type: GraphQLString }
},
async resolve(parent, args, context) {
try {
let pair = await Pair.findOne({id:args.id});
let pair = await Pair.find({id:args.id});
return pair;

} catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion graphql/types/pair.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const {
GraphQLID,
GraphQLString,
GraphQLInt,
GraphQLFloat,
GraphQLOutputType
} = require("graphql");

Expand Down Expand Up @@ -45,7 +46,7 @@ const pairType = new GraphQLObjectType({
txCount: {type: GraphQLInt},

// creation stats
createdAtTimestamp: {type: GraphQLInt},
createdAtTimestamp: {type: GraphQLFloat},
createdAtBlockNumber: {type: GraphQLString},

// Fields used to help derived relationship
Expand Down

0 comments on commit 4fd6f5c

Please sign in to comment.