Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing methods to set metadata in primitives #1053

Open
wants to merge 5 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion packages/client/src/actions/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ import type {
FeedRequest,
FeedsRequest,
Paginated,
SetFeedMetadataRequest,
SetFeedMetadataResult,
} from '@lens-protocol/graphql';
import {
CreateFeedMutation,
FeedQuery,
FeedsQuery,
SetFeedMetadataMutation,
} from '@lens-protocol/graphql';
import { CreateFeedMutation, FeedQuery, FeedsQuery } from '@lens-protocol/graphql';
import type { ResultAsync } from '@lens-protocol/types';

import type { AnyClient, SessionClient } from '../clients';
Expand All @@ -30,6 +37,27 @@ export function createFeed(
return client.mutation(CreateFeedMutation, { request });
}

/**
* Set Feed Metadata
*
* ```ts
* const result = await setFeedMetadata(sessionClient, {
* feed: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'),
* metadataUri: 'https://example.com/feed-metadata.json',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uri

* });
* ```
*
* @param client - The session client logged as a builder.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param client - The session client logged as a builder.
* @param client - The session client logged in as a builder.

* @param request - The mutation request.
* @returns Tiered transaction result.
*/
export function setFeedMetadata(
client: SessionClient,
request: SetFeedMetadataRequest,
): ResultAsync<SetFeedMetadataResult, UnexpectedError | UnauthenticatedError> {
return client.mutation(SetFeedMetadataMutation, { request });
}

/**
* Fetch a Feed.
*
Expand Down
30 changes: 29 additions & 1 deletion packages/client/src/actions/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ import type {
GraphRequest,
GraphsRequest,
Paginated,
SetGraphMetadataRequest,
SetGraphMetadataResult,
} from '@lens-protocol/graphql';
import {
CreateGraphMutation,
GraphQuery,
GraphsQuery,
SetGraphMetadataMutation,
} from '@lens-protocol/graphql';
import { CreateGraphMutation, GraphQuery, GraphsQuery } from '@lens-protocol/graphql';
import type { ResultAsync } from '@lens-protocol/types';

import type { AnyClient, SessionClient } from '../clients';
Expand All @@ -30,6 +37,27 @@ export function createGraph(
return client.mutation(CreateGraphMutation, { request });
}

/**
* Set Graph Metadata
*
* ```ts
* const result = await setGraphMetadata(sessionClient, {
* graph: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'),
* metadataUri: 'https://example.com/feed-metadata.json',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uri

* });
* ```
*
* @param client - The session client logged as a builder.
* @param request - The mutation request.
* @returns Tiered transaction result.
*/
export function setGraphMetadata(
client: SessionClient,
request: SetGraphMetadataRequest,
): ResultAsync<SetGraphMetadataResult, UnexpectedError | UnauthenticatedError> {
return client.mutation(SetGraphMetadataMutation, { request });
}

/**
* Fetch a Graph.
*
Expand Down
24 changes: 24 additions & 0 deletions packages/client/src/actions/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import type {
LeaveGroupRequest,
LeaveGroupResult,
Paginated,
SetGroupMetadataRequest,
SetGroupMetadataResult,
} from '@lens-protocol/graphql';
import {
CreateGroupMutation,
Expand All @@ -22,6 +24,7 @@ import {
GroupsQuery,
JoinGroupMutation,
LeaveGroupMutation,
SetGroupMetadataMutation,
} from '@lens-protocol/graphql';
import type { ResultAsync } from '@lens-protocol/types';

Expand All @@ -46,6 +49,27 @@ export function createGroup(
return client.mutation(CreateGroupMutation, { request });
}

/**
* Set Group Metadata
*
* ```ts
* const result = await setGroupMetadata(sessionClient, {
* group: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'),
* metadataUri: 'https://example.com/feed-metadata.json',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uri

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with lens:// ...example

* });
* ```
*
* @param client - The session client logged as a builder.
* @param request - The mutation request.
* @returns Tiered transaction result.
*/
export function setGroupMetadata(
client: SessionClient,
request: SetGroupMetadataRequest,
): ResultAsync<SetGroupMetadataResult, UnexpectedError | UnauthenticatedError> {
return client.mutation(SetGroupMetadataMutation, { request });
}

/**
* Join a Group
*
Expand Down
24 changes: 24 additions & 0 deletions packages/client/src/actions/namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import type {
NamespaceRequest,
NamespacesRequest,
Paginated,
SetNamespaceMetadataRequest,
SetNamespaceMetadataResult,
UsernameNamespace,
} from '@lens-protocol/graphql';
import {
CreateUsernameNamespaceMutation,
NamespaceQuery,
NamespacesQuery,
SetNamespaceMetadataMutation,
} from '@lens-protocol/graphql';
import type { ResultAsync } from '@lens-protocol/types';

Expand Down Expand Up @@ -37,6 +40,27 @@ export function createUsernameNamespace(
return client.mutation(CreateUsernameNamespaceMutation, { request });
}

/**
* Set Namespace Metadata
*
* ```ts
* const result = await setNamespaceMetadata(sessionClient, {
* namespace: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'),
* metadataUri: 'https://example.com/feed-metadata.json',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

* });
* ```
*
* @param client - The session client logged as a builder.
* @param request - The mutation request.
* @returns Tiered transaction result.
*/
export function setNamespaceMetadata(
client: SessionClient,
request: SetNamespaceMetadataRequest,
): ResultAsync<SetNamespaceMetadataResult, UnexpectedError | UnauthenticatedError> {
return client.mutation(SetNamespaceMetadataMutation, { request });
}

/**
* Fetch a Namespace.
*
Expand Down
9 changes: 6 additions & 3 deletions packages/client/src/actions/username.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,20 @@ export function fetchUsername(
}

/**
* Fetch usernames owned by an address.
* Fetch usernames.
* Example: fetch usernames owned by a specific address.
*
* ```ts
* const result = await fetchUsernames(anyClient, {
* owner: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'),
* filter: {
* owner: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'),
* },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* filter: {
* owner: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'),
* },
* filter: {
* owner: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'),
* },

* });
* ```
*
* @param client - Any Lens client.
* @param request - The query request.
* @returns The list of owned usernames.
* @returns The list of usernames.
*/
export function fetchUsernames(
client: AnyClient,
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4858,7 +4858,7 @@ type SnsSubscription {
app: EvmAddress
topic: SnsNotificationType!
topicArn: String!
attributes: JSON!
filter: JSON!
}

input SnsTopicInput @oneOf {
Expand Down
9 changes: 9 additions & 0 deletions packages/graphql/src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -960,3 +960,12 @@ export enum WhoReferencedPostOrderBy {
Oldest = 'OLDEST',
AccountScore = 'ACCOUNT_SCORE',
}

/**
* Enum for AppUsersOrderBy.
*/
export enum AppUsersOrderBy {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please hook this into the scalar config?

Alphabetical = 'ALPHABETICAL',
AccountScore = 'ACCOUNT_SCORE',
BestMatch = 'BEST_MATCH',
}
31 changes: 31 additions & 0 deletions packages/graphql/src/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
FeedFragment,
PaginatedResultInfoFragment,
SelfFundedTransactionRequestFragment,
SponsoredTransactionRequestFragment,
TransactionWillFailFragment,
} from './fragments';
import { type RequestOf, graphql } from './graphql';
Expand Down Expand Up @@ -41,6 +42,36 @@ export const CreateFeedMutation = graphql(
);
export type CreateFeedRequest = RequestOf<typeof CreateFeedMutation>;

const SetFeedMetadataResultFragment = graphql(
`fragment SetFeedMetadataResult on SetFeedMetadataResult {
... on SponsoredTransactionRequest {
...SponsoredTransactionRequest
}
...on SelfFundedTransactionRequest {
...SelfFundedTransactionRequest
}
...on TransactionWillFail {
...TransactionWillFail
}
}`,
[
SponsoredTransactionRequestFragment,
SelfFundedTransactionRequestFragment,
TransactionWillFailFragment,
],
);
export type SetFeedMetadataResult = FragmentOf<typeof SetFeedMetadataResultFragment>;

export const SetFeedMetadataMutation = graphql(
`mutation SetFeedMetadata($request: SetFeedMetadataRequest!) {
value: setFeedMetadata(request: $request) {
...SetFeedMetadataResult
}
}`,
[SetFeedMetadataResultFragment],
);
export type SetFeedMetadataRequest = RequestOf<typeof SetFeedMetadataMutation>;

export const FeedQuery = graphql(
`query Feed($request: FeedRequest!) {
value: feed(request: $request) {
Expand Down
31 changes: 31 additions & 0 deletions packages/graphql/src/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
GraphFragment,
PaginatedResultInfoFragment,
SelfFundedTransactionRequestFragment,
SponsoredTransactionRequestFragment,
TransactionWillFailFragment,
} from './fragments';
import { type RequestOf, graphql } from './graphql';
Expand Down Expand Up @@ -41,6 +42,36 @@ export const CreateGraphMutation = graphql(
);
export type CreateGraphRequest = RequestOf<typeof CreateGraphMutation>;

const SetGraphMetadataResultFragment = graphql(
`fragment SetGraphMetadataResult on SetGraphMetadataResult {
... on SponsoredTransactionRequest {
...SponsoredTransactionRequest
}
...on SelfFundedTransactionRequest {
...SelfFundedTransactionRequest
}
...on TransactionWillFail {
...TransactionWillFail
}
}`,
[
SponsoredTransactionRequestFragment,
SelfFundedTransactionRequestFragment,
TransactionWillFailFragment,
],
);
export type SetGraphMetadataResult = FragmentOf<typeof SetGraphMetadataResultFragment>;

export const SetGraphMetadataMutation = graphql(
`mutation SetGraphMetadata($request: SetGraphMetadataRequest!) {
value: setGraphMetadata(request: $request) {
...SetGraphMetadataResult
}
}`,
[SetGraphMetadataResultFragment],
);
export type SetGraphMetadataRequest = RequestOf<typeof SetGraphMetadataMutation>;

export const GraphQuery = graphql(
`query Graph($request: GraphRequest!) {
value: graph(request: $request) {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/src/graphql-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export type introspection_types = {
'SimplePaymentGroupRule': { kind: 'OBJECT'; name: 'SimplePaymentGroupRule'; fields: { 'amount': { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Amount'; ofType: null; }; } }; 'recipient': { name: 'recipient'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; 'rule': { name: 'rule'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
'SimplePaymentUsernameNamespaceRule': { kind: 'OBJECT'; name: 'SimplePaymentUsernameNamespaceRule'; fields: { 'amount': { name: 'amount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Amount'; ofType: null; }; } }; 'recipient': { name: 'recipient'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; 'rule': { name: 'rule'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; }; };
'SnsNotificationType': { name: 'SnsNotificationType'; enumValues: 'MEDIA_SNAPSHOT_SUCCESS' | 'MEDIA_SNAPSHOT_ERROR' | 'METADATA_SNAPSHOT_SUCCESS' | 'METADATA_SNAPSHOT_ERROR' | 'POST_CREATED' | 'QUOTE_CREATED' | 'COMMENT_CREATED' | 'REPOST_CREATED' | 'POST_EDITED' | 'POST_DELETED' | 'POST_COLLECTED' | 'POST_ACTION_COMPLETED' | 'POST_REACTION_ADDED' | 'POST_REACTION_REMOVED' | 'POST_REPORTED' | 'ACCOUNT_CREATED' | 'ACCOUNT_MENTIONED' | 'ACCOUNT_FOLLOWED' | 'ACCOUNT_UNFOLLOWED' | 'ACCOUNT_FOLLOW_RULES_UPDATED' | 'ACCOUNT_BLOCKED' | 'ACCOUNT_UNBLOCKED' | 'ACCOUNT_METADATA_UPDATED' | 'ACCOUNT_USERNAME_CREATED' | 'ACCOUNT_USERNAME_ASSIGNED' | 'ACCOUNT_USERNAME_UNASSIGNED' | 'ACCOUNT_CONTENT_CONSUMED' | 'ACCOUNT_MANAGER_ADDED' | 'ACCOUNT_MANAGER_REMOVED' | 'ACCOUNT_MANAGER_UPDATED' | 'ACCOUNT_OWNERSHIP_TRANSFERRED' | 'ACCOUNT_REPORTED' | 'ML_PROFILE_SIGNAL'; };
'SnsSubscription': { kind: 'OBJECT'; name: 'SnsSubscription'; fields: { 'account': { name: 'account'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; 'app': { name: 'app'; type: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; } }; 'attributes': { name: 'attributes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UUID'; ofType: null; }; } }; 'topic': { name: 'topic'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'SnsNotificationType'; ofType: null; }; } }; 'topicArn': { name: 'topicArn'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'webhook': { name: 'webhook'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'URL'; ofType: null; }; } }; }; };
'SnsSubscription': { kind: 'OBJECT'; name: 'SnsSubscription'; fields: { 'account': { name: 'account'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; }; } }; 'app': { name: 'app'; type: { kind: 'SCALAR'; name: 'EvmAddress'; ofType: null; } }; 'filter': { name: 'filter'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UUID'; ofType: null; }; } }; 'topic': { name: 'topic'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'SnsNotificationType'; ofType: null; }; } }; 'topicArn': { name: 'topicArn'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'webhook': { name: 'webhook'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'URL'; ofType: null; }; } }; }; };
'SnsTopicInput': { kind: 'INPUT_OBJECT'; name: 'SnsTopicInput'; isOneOf: true; inputFields: [{ name: 'mediaSnapshotSuccess'; type: { kind: 'INPUT_OBJECT'; name: 'MediaSnapshotNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'mediaSnapshotError'; type: { kind: 'INPUT_OBJECT'; name: 'MediaSnapshotNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'metadataSnapshotSuccess'; type: { kind: 'INPUT_OBJECT'; name: 'MetadataSnapshotNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'metadataSnapshotError'; type: { kind: 'INPUT_OBJECT'; name: 'MetadataSnapshotNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'postCreated'; type: { kind: 'INPUT_OBJECT'; name: 'PostCreatedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'quoteCreated'; type: { kind: 'INPUT_OBJECT'; name: 'PostCreatedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'commentCreated'; type: { kind: 'INPUT_OBJECT'; name: 'PostCreatedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'repostCreated'; type: { kind: 'INPUT_OBJECT'; name: 'PostCreatedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'postEdited'; type: { kind: 'INPUT_OBJECT'; name: 'PostEditedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'postDeleted'; type: { kind: 'INPUT_OBJECT'; name: 'PostDeletedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'postReactionAdded'; type: { kind: 'INPUT_OBJECT'; name: 'PostReactionAddedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'postReactionRemoved'; type: { kind: 'INPUT_OBJECT'; name: 'PostReactionRemovedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'postReported'; type: { kind: 'INPUT_OBJECT'; name: 'PostReportedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountCreated'; type: { kind: 'INPUT_OBJECT'; name: 'AccountCreatedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountMentioned'; type: { kind: 'INPUT_OBJECT'; name: 'AccountMentionedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountFollowed'; type: { kind: 'INPUT_OBJECT'; name: 'AccountFollowedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountUnfollowed'; type: { kind: 'INPUT_OBJECT'; name: 'AccountUnfollowedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountBlocked'; type: { kind: 'INPUT_OBJECT'; name: 'AccountBlockedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountUnblocked'; type: { kind: 'INPUT_OBJECT'; name: 'AccountUnblockedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountUsernameCreated'; type: { kind: 'INPUT_OBJECT'; name: 'AccountUsernameCreatedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountUsernameAssigned'; type: { kind: 'INPUT_OBJECT'; name: 'AccountUsernameAssignedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountUsernameUnassigned'; type: { kind: 'INPUT_OBJECT'; name: 'AccountUsernameUnassignedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountManagerAdded'; type: { kind: 'INPUT_OBJECT'; name: 'AccountManagerAddedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountManagerRemoved'; type: { kind: 'INPUT_OBJECT'; name: 'AccountManagerRemovedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountManagerUpdated'; type: { kind: 'INPUT_OBJECT'; name: 'AccountManagerUpdatedNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountOwnershipTransferred'; type: { kind: 'INPUT_OBJECT'; name: 'AccountOwnershipTransferredNotificationAttributes'; ofType: null; }; defaultValue: null }, { name: 'accountReported'; type: { kind: 'INPUT_OBJECT'; name: 'AccountReportedNotificationAttributes'; ofType: null; }; defaultValue: null }]; };
'SpaceMetadata': { kind: 'OBJECT'; name: 'SpaceMetadata'; fields: { 'attachments': { name: 'attachments'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'UNION'; name: 'AnyMedia'; ofType: null; }; }; }; } }; 'attributes': { name: 'attributes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'MetadataAttribute'; ofType: null; }; }; }; } }; 'content': { name: 'content'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'contentWarning': { name: 'contentWarning'; type: { kind: 'ENUM'; name: 'ContentWarning'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'MetadataId'; ofType: null; }; } }; 'link': { name: 'link'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'URI'; ofType: null; }; } }; 'locale': { name: 'locale'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Locale'; ofType: null; }; } }; 'mainContentFocus': { name: 'mainContentFocus'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'MainContentFocus'; ofType: null; }; } }; 'startsAt': { name: 'startsAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'tags': { name: 'tags'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Tag'; ofType: null; }; }; } }; 'title': { name: 'title'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
'SponsorLimitType': { name: 'SponsorLimitType'; enumValues: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH'; };
Expand Down
30 changes: 30 additions & 0 deletions packages/graphql/src/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,36 @@ export const CreateGroupMutation = graphql(
);
export type CreateGroupRequest = RequestOf<typeof CreateGroupMutation>;

const SetGroupMetadataResultFragment = graphql(
`fragment SetGroupMetadataResult on SetGroupMetadataResult {
... on SponsoredTransactionRequest {
...SponsoredTransactionRequest
}
...on SelfFundedTransactionRequest {
...SelfFundedTransactionRequest
}
...on TransactionWillFail {
...TransactionWillFail
}
}`,
[
SponsoredTransactionRequestFragment,
SelfFundedTransactionRequestFragment,
TransactionWillFailFragment,
],
);
export type SetGroupMetadataResult = FragmentOf<typeof SetGroupMetadataResultFragment>;

export const SetGroupMetadataMutation = graphql(
`mutation SetGroupMetadata($request: SetGroupMetadataRequest!) {
value: setGroupMetadata(request: $request) {
...SetGroupMetadataResult
}
}`,
[SetGroupMetadataResultFragment],
);
export type SetGroupMetadataRequest = RequestOf<typeof SetGroupMetadataMutation>;

const JoinGroupResponseFragment = graphql(
`fragment JoinGroupResponse on JoinGroupResponse {
__typename
Expand Down
Loading
Loading