From 14301a757df747e8e1cfc9732d68d34fa38cfc85 Mon Sep 17 00:00:00 2001 From: Peter Harrison <16875803+palisadoes@users.noreply.github.com> Date: Wed, 28 Feb 2024 13:36:59 -0800 Subject: [PATCH] Revert "Fix/fetch postby user (#1910)" (#1913) This reverts commit 41713abb566a8b76bc3ad7b4e6161a273ca42d79. --- schema.graphql | 2 +- src/resolvers/Organization/index.ts | 3 +-- src/typeDefs/types.ts | 2 +- src/types/generatedGraphQLTypes.ts | 4 ++-- tests/resolvers/Organization/posts.spec.ts | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/schema.graphql b/schema.graphql index 086771813c..f1a198c875 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1223,7 +1223,7 @@ input PostWhereInput { type PostsConnection { edges: [PostEdge!]! - pageInfo: DefaultConnectionPageInfo! + pageInfo: ConnectionPageInfo! totalCount: PositiveInt } diff --git a/src/resolvers/Organization/index.ts b/src/resolvers/Organization/index.ts index 3bc6300af8..bba49bc7d6 100644 --- a/src/resolvers/Organization/index.ts +++ b/src/resolvers/Organization/index.ts @@ -8,8 +8,8 @@ import { funds } from "./funds"; import { image } from "./image"; import { members } from "./members"; import { membershipRequests } from "./membershipRequests"; + import { pinnedPosts } from "./pinnedPosts"; -import { posts } from "./posts"; import { advertisements } from "./advertisements"; @@ -27,6 +27,5 @@ export const Organization: OrganizationResolvers = { membershipRequests, pinnedPosts, funds, - posts, // userTags, }; diff --git a/src/typeDefs/types.ts b/src/typeDefs/types.ts index 3d7c78b4e2..4c522631df 100644 --- a/src/typeDefs/types.ts +++ b/src/typeDefs/types.ts @@ -531,7 +531,7 @@ export const types = gql` } type PostsConnection { edges: [PostEdge!]! - pageInfo: DefaultConnectionPageInfo! + pageInfo: ConnectionPageInfo! totalCount: PositiveInt } type PostEdge { diff --git a/src/types/generatedGraphQLTypes.ts b/src/types/generatedGraphQLTypes.ts index a79a131129..08883199f7 100644 --- a/src/types/generatedGraphQLTypes.ts +++ b/src/types/generatedGraphQLTypes.ts @@ -1924,7 +1924,7 @@ export type PostWhereInput = { export type PostsConnection = { __typename?: 'PostsConnection'; edges: Array; - pageInfo: DefaultConnectionPageInfo; + pageInfo: ConnectionPageInfo; totalCount?: Maybe; }; @@ -3727,7 +3727,7 @@ export type PostEdgeResolvers = { edges?: Resolver, ParentType, ContextType>; - pageInfo?: Resolver; + pageInfo?: Resolver; totalCount?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; diff --git a/tests/resolvers/Organization/posts.spec.ts b/tests/resolvers/Organization/posts.spec.ts index 08fb3030e2..fa40167fc1 100644 --- a/tests/resolvers/Organization/posts.spec.ts +++ b/tests/resolvers/Organization/posts.spec.ts @@ -68,7 +68,7 @@ describe("resolvers -> Organization -> post", () => { ); const totalCount = await Post.find({ - organization: testOrganization?._id, + creatorId: testUser?._id, }).countDocuments(); expect((connection?.edges[0] as unknown as PostEdge).cursor).toEqual(