Skip to content

Commit

Permalink
Revert "Revert "Fix/fetch postby user (#1910)" (#1913)"
Browse files Browse the repository at this point in the history
This reverts commit 14301a7.
  • Loading branch information
palisadoes authored Feb 28, 2024
1 parent 14301a7 commit eb295e5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ input PostWhereInput {

type PostsConnection {
edges: [PostEdge!]!
pageInfo: ConnectionPageInfo!
pageInfo: DefaultConnectionPageInfo!
totalCount: PositiveInt
}

Expand Down
3 changes: 2 additions & 1 deletion src/resolvers/Organization/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -27,5 +27,6 @@ export const Organization: OrganizationResolvers = {
membershipRequests,
pinnedPosts,
funds,
posts,
// userTags,
};
2 changes: 1 addition & 1 deletion src/typeDefs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export const types = gql`
}
type PostsConnection {
edges: [PostEdge!]!
pageInfo: ConnectionPageInfo!
pageInfo: DefaultConnectionPageInfo!
totalCount: PositiveInt
}
type PostEdge {
Expand Down
4 changes: 2 additions & 2 deletions src/types/generatedGraphQLTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ export type PostWhereInput = {
export type PostsConnection = {
__typename?: 'PostsConnection';
edges: Array<PostEdge>;
pageInfo: ConnectionPageInfo;
pageInfo: DefaultConnectionPageInfo;
totalCount?: Maybe<Scalars['PositiveInt']['output']>;
};

Expand Down Expand Up @@ -3727,7 +3727,7 @@ export type PostEdgeResolvers<ContextType = any, ParentType extends ResolversPar

export type PostsConnectionResolvers<ContextType = any, ParentType extends ResolversParentTypes['PostsConnection'] = ResolversParentTypes['PostsConnection']> = {
edges?: Resolver<Array<ResolversTypes['PostEdge']>, ParentType, ContextType>;
pageInfo?: Resolver<ResolversTypes['ConnectionPageInfo'], ParentType, ContextType>;
pageInfo?: Resolver<ResolversTypes['DefaultConnectionPageInfo'], ParentType, ContextType>;
totalCount?: Resolver<Maybe<ResolversTypes['PositiveInt']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
Expand Down
2 changes: 1 addition & 1 deletion tests/resolvers/Organization/posts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("resolvers -> Organization -> post", () => {
);

const totalCount = await Post.find({
creatorId: testUser?._id,
organization: testOrganization?._id,
}).countDocuments();

expect((connection?.edges[0] as unknown as PostEdge).cursor).toEqual(
Expand Down

0 comments on commit eb295e5

Please sign in to comment.