diff --git a/nft-platform.rest b/nft-platform.rest index b893c38..a975c8a 100644 --- a/nft-platform.rest +++ b/nft-platform.rest @@ -1,12 +1,6 @@ -GET http://localhost:3003/ping HTTP/1.1 +GET http://localhost:4000/ping HTTP/1.1 ### -POST http://localhost:3003/multiply HTTP/1.1 -content-type: application/json - -{ - "value1": "2", - "value2": "3" -} +GET http://localhost:4000/metadata/0x00AA/22 HTTP/1.1 ### GET http://localhost:3003/undefinedRoute HTTP/1.1 ### diff --git a/resolvers.ts b/resolvers.ts index ac5ad73..1c8b077 100644 --- a/resolvers.ts +++ b/resolvers.ts @@ -1,24 +1,9 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { getConsentMessageToSign, handleAddSignedConsent, consentNeeded as handleConsentNeeded, getRevokeConsentMessageToSign, revokeSignedConsent } from './services/consentService'; -import { multiply } from './services/demoService'; import { addPendingMetadataFromClient, getMetadataUploadMessageToSign } from './services/metadataService'; -import { MultiplyPayloadDemo } from './types'; export const resolvers = { Query: { - allBooks: () => { - const mockBooks =[ - { title: 'title1', author: 'author1' }, - { title: 'title2', author: 'author2' } - ]; - return mockBooks; - }, - multiply(_root: any, args: any) { - const payload: MultiplyPayloadDemo = { value1: args.value1 as number, value2: args.value2 as number }; - const result = multiply(payload); - const resultObject = { value: result }; - return resultObject; - }, getMetadataUploadMessageToSign(_root: any, args: any) { const txHash = args.txHash as string; const metadata = args.metadata as string; diff --git a/schema.ts b/schema.ts index 8b42301..50b06dc 100644 --- a/schema.ts +++ b/schema.ts @@ -2,23 +2,12 @@ import { gql } from 'apollo-server'; import { TypeSource } from '@graphql-tools/utils'; export const schemaDefs: TypeSource = gql` - type Book { - title: String! - author: String! - } - - type MultiplyResult { - value: Int! - } - type Result { success: Boolean!, message: String } type Query { - allBooks: [Book!]! - multiply(value1: Int!, value2: Int!): MultiplyResult! getMetadataUploadMessageToSign(txHash: String!, metadata: String!): String! getConsentMessageToSign: String! getRevokeConsentMessageToSign: String! diff --git a/services/demoService.ts b/services/demoService.ts deleted file mode 100644 index 83bffd1..0000000 --- a/services/demoService.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { MultiplyPayloadDemo } from '../types'; - -export const multiply = (data: MultiplyPayloadDemo): number => { - return data.value1 * data.value2; -}; diff --git a/types.ts b/types.ts index 79c03be..d112567 100644 --- a/types.ts +++ b/types.ts @@ -1,9 +1,4 @@ -export interface MultiplyPayloadDemo { - value1: number, - value2: number -} - export interface Result { success: boolean, message?: string