Skip to content

Commit

Permalink
chore: renames account, manager, and common fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarenaldi committed Dec 17, 2024
1 parent a11dc72 commit d200bff
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 78 deletions.
82 changes: 42 additions & 40 deletions packages/graphql/src/accounts/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ export const AccountsBulkQuery = graphql(
);
export type AccountsBulkRequest = RequestOf<typeof AccountsBulkQuery>;

const SetAccountMetadataResponse = graphql(
const SetAccountMetadataResponseFragment = graphql(
`fragment SetAccountMetadataResponse on SetAccountMetadataResponse {
__typename
hash
}`,
);
export type SetAccountMetadataResponse = FragmentOf<typeof SetAccountMetadataResponse>;
export type SetAccountMetadataResponse = FragmentOf<typeof SetAccountMetadataResponseFragment>;

const SetAccountMetadataResult = graphql(
const SetAccountMetadataResultFragment = graphql(
`fragment SetAccountMetadataResult on SetAccountMetadataResult {
...on SetAccountMetadataResponse {
...SetAccountMetadataResponse
Expand All @@ -73,31 +73,31 @@ const SetAccountMetadataResult = graphql(
}
}`,
[
SetAccountMetadataResponse,
SetAccountMetadataResponseFragment,
SponsoredTransactionRequestFragment,
SelfFundedTransactionRequestFragment,
TransactionWillFailFragment,
],
);
export type SetAccountMetadataResult = FragmentOf<typeof SetAccountMetadataResult>;
export type SetAccountMetadataResult = FragmentOf<typeof SetAccountMetadataResultFragment>;

export const SetAccountMetadataMutation = graphql(
`mutation SetAccountMetadata($request: SetAccountMetadataRequest!) {
value: setAccountMetadata(request: $request) {
...SetAccountMetadataResult
}
}`,
[SetAccountMetadataResult],
[SetAccountMetadataResultFragment],
);
export type SetAccountMetadataRequest = RequestOf<typeof SetAccountMetadataMutation>;

const CreateAccountResponse = graphql(
const CreateAccountResponseFragment = graphql(
`fragment CreateAccountResponse on CreateAccountResponse {
__typename
hash
}`,
);
export type CreateAccountResponse = FragmentOf<typeof CreateAccountResponse>;
export type CreateAccountResponse = FragmentOf<typeof CreateAccountResponseFragment>;

const InvalidUsernameFragment = graphql(
`fragment InvalidUsername on InvalidUsername {
Expand All @@ -107,7 +107,7 @@ const InvalidUsernameFragment = graphql(
);
export type InvalidUsername = FragmentOf<typeof InvalidUsernameFragment>;

const CreateAccountWithUsernameResult = graphql(
const CreateAccountWithUsernameResultFragment = graphql(
`fragment CreateAccountWithUsernameResult on CreateAccountWithUsernameResult {
...on CreateAccountResponse {
...CreateAccountResponse
Expand All @@ -130,27 +130,29 @@ const CreateAccountWithUsernameResult = graphql(
}
}`,
[
CreateAccountResponse,
CreateAccountResponseFragment,
SponsoredTransactionRequestFragment,
SelfFundedTransactionRequestFragment,
InvalidUsernameFragment,
TransactionWillFailFragment,
],
);
export type CreateAccountWithUsernameResult = FragmentOf<typeof CreateAccountWithUsernameResult>;
export type CreateAccountWithUsernameResult = FragmentOf<
typeof CreateAccountWithUsernameResultFragment
>;

export const CreateAccountWithUsernameMutation = graphql(
`mutation CreateAccountWithUsername($request: CreateAccountWithUsernameRequest!) {
value: createAccountWithUsername(request: $request) {
...CreateAccountWithUsernameResult
}
}`,
[CreateAccountWithUsernameResult],
[CreateAccountWithUsernameResultFragment],
);

export type CreateAccountWithUsernameRequest = RequestOf<typeof CreateAccountWithUsernameMutation>;

const AccountFeedsStats = graphql(
const AccountFeedsStatsFragment = graphql(
`fragment AccountFeedsStats on AccountFeedsStats {
__typename
posts
Expand All @@ -162,18 +164,18 @@ const AccountFeedsStats = graphql(
collects
}`,
);
export type AccountFeedsStats = FragmentOf<typeof AccountFeedsStats>;
export type AccountFeedsStats = FragmentOf<typeof AccountFeedsStatsFragment>;

const AccountGraphsFollowStats = graphql(
const AccountGraphsFollowStatsFragment = graphql(
`fragment AccountGraphsFollowStats on AccountGraphsFollowStats {
__typename
followers
following
}`,
);
export type AccountGraphsFollowStats = FragmentOf<typeof AccountGraphsFollowStats>;
export type AccountGraphsFollowStats = FragmentOf<typeof AccountGraphsFollowStatsFragment>;

const AccountStats = graphql(
const AccountStatsFragment = graphql(
`fragment AccountStats on AccountStats {
__typename
feedStats {
Expand All @@ -183,17 +185,17 @@ const AccountStats = graphql(
...AccountGraphsFollowStats
}
}`,
[AccountFeedsStats, AccountGraphsFollowStats],
[AccountFeedsStatsFragment, AccountGraphsFollowStatsFragment],
);
export type AccountStats = FragmentOf<typeof AccountStats>;
export type AccountStats = FragmentOf<typeof AccountStatsFragment>;

export const AccountFeedsStatsQuery = graphql(
`query AccountFeedsStats($request: AccountFeedsStatsRequest!) {
value: accountFeedsStats(request: $request) {
...AccountFeedsStats
}
}`,
[AccountFeedsStats],
[AccountFeedsStatsFragment],
);

export type AccountFeedsStatsRequest = RequestOf<typeof AccountFeedsStatsQuery>;
Expand All @@ -204,7 +206,7 @@ export const AccountStatsQuery = graphql(
...AccountStats
}
}`,
[AccountStats],
[AccountStatsFragment],
);

export type AccountStatsRequest = RequestOf<typeof AccountStatsQuery>;
Expand All @@ -215,7 +217,7 @@ export const AccountGraphsStatsQuery = graphql(
...AccountGraphsFollowStats
}
}`,
[AccountGraphsFollowStats],
[AccountGraphsFollowStatsFragment],
);

export type AccountGraphsStatsRequest = RequestOf<typeof AccountGraphsStatsQuery>;
Expand Down Expand Up @@ -273,23 +275,23 @@ export const ReportAccountMutation = graphql(
);
export type ReportAccountRequest = RequestOf<typeof ReportAccountMutation>;

const BlockError = graphql(
const BlockErrorFragment = graphql(
`fragment BlockError on BlockError {
__typename
error
}`,
);
export type BlockError = FragmentOf<typeof BlockError>;
export type BlockError = FragmentOf<typeof BlockErrorFragment>;

const BlockResponse = graphql(
const BlockResponseFragment = graphql(
`fragment BlockResponse on BlockResponse {
__typename
hash
}`,
);
export type BlockResponse = FragmentOf<typeof BlockResponse>;
export type BlockResponse = FragmentOf<typeof BlockResponseFragment>;

const BlockResult = graphql(
const BlockResultFragment = graphql(
`fragment BlockResult on BlockResult {
...on BlockResponse {
...BlockResponse
Expand All @@ -308,41 +310,41 @@ const BlockResult = graphql(
}
}`,
[
BlockResponse,
BlockResponseFragment,
SponsoredTransactionRequestFragment,
SelfFundedTransactionRequestFragment,
BlockError,
BlockErrorFragment,
],
);
export type BlockResult = FragmentOf<typeof BlockResult>;
export type BlockResult = FragmentOf<typeof BlockResultFragment>;

export const BlockMutation = graphql(
`mutation Block($request: BlockRequest!) {
value: block(request: $request){
...BlockResult
}
}`,
[BlockResult],
[BlockResultFragment],
);
export type BlockRequest = RequestOf<typeof BlockMutation>;

const UnblockResponse = graphql(
const UnblockResponseFragment = graphql(
`fragment UnblockResponse on UnblockResponse {
__typename
hash
}`,
);
export type UnblockResponse = FragmentOf<typeof UnblockResponse>;
export type UnblockResponse = FragmentOf<typeof UnblockResponseFragment>;

const UnblockError = graphql(
const UnblockErrorFragment = graphql(
`fragment UnblockError on UnblockError {
__typename
error
}`,
);
export type UnblockError = FragmentOf<typeof UnblockError>;
export type UnblockError = FragmentOf<typeof UnblockErrorFragment>;

const UnblockResult = graphql(
const UnblockResultFragment = graphql(
`fragment UnblockResult on UnblockResult {
...on UnblockResponse {
...UnblockResponse
Expand All @@ -358,21 +360,21 @@ const UnblockResult = graphql(
}
}`,
[
UnblockResponse,
UnblockResponseFragment,
SponsoredTransactionRequestFragment,
SelfFundedTransactionRequestFragment,
UnblockError,
UnblockErrorFragment,
],
);
export type UnblockResult = FragmentOf<typeof UnblockResult>;
export type UnblockResult = FragmentOf<typeof UnblockResultFragment>;

export const UnblockMutation = graphql(
`mutation Unblock($request: UnblockRequest!) {
value: unblock(request: $request){
...UnblockResult
}
}`,
[UnblockResult],
[UnblockResultFragment],
);
export type UnblockRequest = RequestOf<typeof UnblockMutation>;

Expand Down
18 changes: 9 additions & 9 deletions packages/graphql/src/accounts/managers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const AccountManagersQuery = graphql(

export type AccountManagersRequest = RequestOf<typeof AccountManagersQuery>;

const AddAccountManagerResult = graphql(
const AddAccountManagerResultFragment = graphql(
`fragment AddAccountManagerResult on AddAccountManagerResult{
...on SponsoredTransactionRequest {
...SponsoredTransactionRequest
Expand All @@ -42,19 +42,19 @@ const AddAccountManagerResult = graphql(
TransactionWillFailFragment,
],
);
export type AddAccountManagerResult = FragmentOf<typeof AddAccountManagerResult>;
export type AddAccountManagerResult = FragmentOf<typeof AddAccountManagerResultFragment>;

export const AddAccountManagerMutation = graphql(
`mutation AddAccountManager($request: AddAccountManagerRequest!) {
value: addAccountManager(request: $request) {
...AddAccountManagerResult
}
}`,
[AddAccountManagerResult],
[AddAccountManagerResultFragment],
);
export type AddAccountManagerRequest = RequestOf<typeof AddAccountManagerMutation>;

const RemoveAccountManagerResult = graphql(
const RemoveAccountManagerResultFragment = graphql(
`fragment RemoveAccountManagerResult on RemoveAccountManagerResult{
...on SponsoredTransactionRequest {
...SponsoredTransactionRequest
Expand All @@ -72,19 +72,19 @@ const RemoveAccountManagerResult = graphql(
TransactionWillFailFragment,
],
);
export type RemoveAccountManagerResult = FragmentOf<typeof RemoveAccountManagerResult>;
export type RemoveAccountManagerResult = FragmentOf<typeof RemoveAccountManagerResultFragment>;

export const RemoveAccountManagerMutation = graphql(
`mutation RemoveAccountManager($request: RemoveAccountManagerRequest!) {
value: removeAccountManager(request: $request) {
...RemoveAccountManagerResult
}
}`,
[RemoveAccountManagerResult],
[RemoveAccountManagerResultFragment],
);
export type RemoveAccountManagerRequest = RequestOf<typeof RemoveAccountManagerMutation>;

const UpdateAccountManagerResult = graphql(
const UpdateAccountManagerResultFragment = graphql(
`fragment UpdateAccountManagerResult on UpdateAccountManagerResult{
...on SponsoredTransactionRequest {
...SponsoredTransactionRequest
Expand All @@ -102,15 +102,15 @@ const UpdateAccountManagerResult = graphql(
TransactionWillFailFragment,
],
);
export type UpdateAccountManagerResult = FragmentOf<typeof UpdateAccountManagerResult>;
export type UpdateAccountManagerResult = FragmentOf<typeof UpdateAccountManagerResultFragment>;

export const UpdateAccountManagerMutation = graphql(
`mutation RemoveAccountManager($request: UpdateAccountManagerRequest!) {
value: updateAccountManager(request: $request) {
...UpdateAccountManagerResult
}
}`,
[UpdateAccountManagerResult],
[UpdateAccountManagerResultFragment],
);
export type UpdateAccountManagerRequest = RequestOf<typeof UpdateAccountManagerMutation>;

Expand Down
12 changes: 6 additions & 6 deletions packages/graphql/src/accounts/signless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '../fragments';
import { graphql } from '../graphql';

const EnableSignlessResult = graphql(
const EnableSignlessResultFragment = graphql(
`fragment EnableSignlessResult on EnableSignlessResult{
...on SponsoredTransactionRequest {
...SponsoredTransactionRequest
Expand All @@ -25,18 +25,18 @@ const EnableSignlessResult = graphql(
TransactionWillFailFragment,
],
);
export type EnableSignlessResult = FragmentOf<typeof EnableSignlessResult>;
export type EnableSignlessResult = FragmentOf<typeof EnableSignlessResultFragment>;

export const EnableSignlessMutation = graphql(
`mutation EnableSignless {
value: enableSignless {
...EnableSignlessResult
}
}`,
[EnableSignlessResult],
[EnableSignlessResultFragment],
);

const RemoveSignlessResult = graphql(
const RemoveSignlessResultFragment = graphql(
`fragment RemoveSignlessResult on RemoveSignlessResult{
...on SponsoredTransactionRequest {
...SponsoredTransactionRequest
Expand All @@ -54,13 +54,13 @@ const RemoveSignlessResult = graphql(
TransactionWillFailFragment,
],
);
export type RemoveSignlessResult = FragmentOf<typeof RemoveSignlessResult>;
export type RemoveSignlessResult = FragmentOf<typeof RemoveSignlessResultFragment>;

export const RemoveSignlessMutation = graphql(
`mutation RemoveSignless {
value: removeSignless {
...RemoveSignlessResult
}
}`,
[RemoveSignlessResult],
[RemoveSignlessResultFragment],
);
Loading

0 comments on commit d200bff

Please sign in to comment.