Skip to content

Commit

Permalink
add types
Browse files Browse the repository at this point in the history
  • Loading branch information
sainthiago committed Jan 4, 2023
1 parent ab3573a commit 82a22c0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion packages/data/src/api/tokenOwner/tokenOwner.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GraphQLClient } from 'graphql-request';
import { tokenOwner, TokenOwnerQueryResult } from './tokenOwner';
import { tokenOwner } from './tokenOwner';
import { tokenOwnerMock } from './tokenOwner.mock';
import { TokenOwnerQueryResult } from './tokenOwner.types';

jest.mock('graphql-request');

Expand Down
7 changes: 2 additions & 5 deletions packages/data/src/api/tokenOwner/tokenOwner.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { fetchGraphQl } from '../../graphql/fetch';
import { ParsedDataReturn, TokenOwner } from '../../types';
import { ParsedDataReturn } from '../../types';
import { parseData } from '../../utils';
import { tokenOwnerQuery } from './tokenOwner.query';

export type TokenOwnerQueryResult = {
mb_views_nft_tokens: TokenOwner[];
};
import { TokenOwnerQueryResult } from './tokenOwner.types';

export const tokenOwner = async (
tokenId: string,
Expand Down
7 changes: 7 additions & 0 deletions packages/data/src/api/tokenOwner/tokenOwner.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export type TokenOwnerQueryResult = {
mb_views_nft_tokens: TokenOwner[];
}

export type TokenOwner = {
owner: string;
}
4 changes: 0 additions & 4 deletions packages/data/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export type Token = {
animationUrl: string;
}

export type TokenOwner = {
owner: string;
}

export interface ParsedDataReturn<T> {
error?: null | string;
data?: T | null;
Expand Down

0 comments on commit 82a22c0

Please sign in to comment.