From cdc6ed5af8610e469c100feab72fdc41d3f482ed Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Sun, 25 Jun 2023 15:04:53 +0800 Subject: [PATCH] change sth --- src/api.server.ts | 5 +++++ src/schema/index.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/api.server.ts b/src/api.server.ts index eed8f60..53288b1 100644 --- a/src/api.server.ts +++ b/src/api.server.ts @@ -74,6 +74,11 @@ export class ApiServer { } } private initGraphql() { + this.server.addHook('onRequest', (request, reply, done) => { + // Some code + console.log(request) + done() + }) this.server.register(mercurius, { schema, graphiql: true, diff --git a/src/schema/index.ts b/src/schema/index.ts index 5a12405..78e86d4 100644 --- a/src/schema/index.ts +++ b/src/schema/index.ts @@ -21,9 +21,9 @@ const RootQuery = new GraphQLObjectType({ fields: { nft: { type: nftType, - args: { address: { type: GraphQLID }, contract: { type: GraphQLString } }, + args: { address: { type: GraphQLString }, contract: { type: GraphQLString } }, async resolve(parent, args) { - return getFirstToken(args.address, args.contract) + return await getFirstToken(args.address, args.contract) }, }, nfts: {