Skip to content

Commit 1b3b155

Browse files
authored
Accepting or rejecting mutations for user-teams / Updating ID exposure / Removing hyperdrive cache (#205)
1 parent 6843049 commit 1b3b155

13 files changed

Lines changed: 18 additions & 14 deletions

File tree

src/schema/allowedCurrency/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const ValidPaymentMethodsEnumType = builder.enumType("ValidPaymentMethods", {
99
builder.objectType(AllowedCurrencyRef, {
1010
description: "Representation of a workEmail",
1111
fields: (t) => ({
12-
id: t.exposeString("id", { nullable: false }),
12+
id: t.exposeID("id", { nullable: false }),
1313
validPaymentMethods: t.field({
1414
nullable: false,
1515
type: ValidPaymentMethodsEnumType,

src/schema/assets/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { SanityAssetRef } from "~/schema/shared/refs";
44
builder.objectType(SanityAssetRef, {
55
description: "Representation of a Sanity Asset",
66
fields: (t) => ({
7-
id: t.exposeString("id", { nullable: false }),
7+
id: t.exposeID("id", { nullable: false }),
88
assetId: t.exposeString("assetId", { nullable: false }),
99
path: t.exposeString("path", { nullable: false }),
1010
url: t.exposeString("url", { nullable: false }),

src/schema/community/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const CommnunityStatus = builder.enumType("CommnunityStatus", {
1111
builder.objectType(CommunityRef, {
1212
description: "Representation of a Community",
1313
fields: (t) => ({
14-
id: t.exposeString("id", { nullable: false }),
14+
id: t.exposeID("id", { nullable: false }),
1515
name: t.exposeString("name", { nullable: true }),
1616
description: t.exposeString("description", { nullable: true }),
1717
status: t.field({

src/schema/company/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const CompanyStatus = builder.enumType("CompanyStatus", {
88
builder.objectType(CompanyRef, {
99
description: "Representation of a workEmail",
1010
fields: (t) => ({
11-
id: t.exposeString("id", { nullable: false }),
11+
id: t.exposeID("id", { nullable: false }),
1212
name: t.exposeString("name", { nullable: true }),
1313
description: t.exposeString("description", { nullable: true }),
1414
domain: t.exposeString("domain", { nullable: false }),

src/schema/events/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const EventLoadable = builder.loadableObject(EventRef, {
7272
sort: null,
7373
}),
7474
fields: (t) => ({
75-
id: t.exposeString("id", { nullable: false }),
75+
id: t.exposeID("id", { nullable: false }),
7676
name: t.exposeString("name", { nullable: false }),
7777
description: t.exposeString("description", { nullable: true }),
7878
status: t.field({

src/schema/money/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
builder.objectType(PaymentLogRef, {
88
description: "Representation of a payment log entry",
99
fields: (t) => ({
10-
id: t.exposeString("id", { nullable: false }),
10+
id: t.exposeID("id", { nullable: false }),
1111
transactionAmount: t.field({
1212
type: "Float",
1313
nullable: false,
@@ -32,7 +32,7 @@ builder.objectType(PaymentLogRef, {
3232
builder.objectType(ConsolidatedPaymentLogEntryRef, {
3333
description: "Representation of a consolidated payment entry log calculation",
3434
fields: (t) => ({
35-
id: t.exposeString("id", { nullable: false }),
35+
id: t.exposeID("id", { nullable: false }),
3636
totalTransactionAmount: t.exposeFloat("totalTransactionAmount"),
3737
platform: t.exposeString("platform", { nullable: false }),
3838
currencyId: t.exposeString("currencyId", { nullable: false }),

src/schema/salary/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const WorkMetodology = builder.enumType("WorkMetodology", {
2323
builder.objectType(SalaryRef, {
2424
description: "Representation of a workEmail",
2525
fields: (t) => ({
26-
id: t.exposeString("id", { nullable: false }),
26+
id: t.exposeID("id", { nullable: false }),
2727
company: t.field({
2828
type: CompanyRef,
2929
nullable: false,

src/schema/tags/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ builder.objectType(TagRef, {
77
description:
88
"Representation of a tag. Tags can be associated to many things. An event, a community, etc.",
99
fields: (t) => ({
10-
id: t.exposeString("id", { nullable: false }),
10+
id: t.exposeID("id", { nullable: false }),
1111
name: t.exposeString("name", { nullable: true }),
1212
slug: t.field({
1313
type: "String",

src/schema/teams/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const UserTeamRole = builder.enumType(UserTeamRoleEnum, {
4343
});
4444

4545
export const UserWithStatusRef = builder.objectRef<{
46+
id: string;
4647
user: UserGraphqlSchema;
4748
role: UserTeamRoleEnum;
4849
status: UserParticipationStatusEnum;
@@ -51,6 +52,7 @@ export const UserWithStatusRef = builder.objectRef<{
5152
builder.objectType(UserWithStatusRef, {
5253
description: "Representation of a user in a team",
5354
fields: (t) => ({
55+
id: t.exposeID("id"),
5456
user: t.field({
5557
type: UserRef,
5658
resolve: (root) => root.user,
@@ -89,6 +91,7 @@ builder.objectType(TeamRef, {
8991
type: [UserWithStatusRef],
9092
resolve: async (root, args, ctx) => {
9193
// TODO: Use a dataloader here
94+
9295
const teamWithUsers = await ctx.DB.query.userTeamsSchema.findMany({
9396
where: (uts, { eq }) => eq(uts.teamId, root.id),
9497
with: {
@@ -102,6 +105,7 @@ builder.objectType(TeamRef, {
102105

103106
return teamWithUsers.map((tu) => {
104107
return {
108+
id: tu.userId,
105109
user: selectUsersSchema.parse(tu.user),
106110
role: tu.role,
107111
status: tu.userParticipationStatus,

src/schema/user/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const pronounsEnum = builder.enumType(PronounsEnum, {
1616
builder.objectType(UserRef, {
1717
description: "Representation of a user",
1818
fields: (t) => ({
19-
id: t.exposeString("id", { nullable: false }),
19+
id: t.exposeID("id", { nullable: false }),
2020
name: t.exposeString("name", { nullable: true }),
2121
username: t.exposeString("username", { nullable: false }),
2222
lastName: t.exposeString("lastName", { nullable: true }),

0 commit comments

Comments
 (0)