Skip to content

Commit

Permalink
feat(apps/gql): add site resolver to PanoPost type
Browse files Browse the repository at this point in the history
  • Loading branch information
usirin committed Aug 1, 2023
1 parent df01dc8 commit 3e3636d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/gql/schema/resolvers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const resolvers = {
title: (post) => post.title,
url: (post) => post.url,
content: (post) => post.content,
site: (post) => post.site,
owner: async (parent, _, { loaders }) => {
const post = await loaders.pano.post.byID.load(parent.id);
const user = await loaders.user.byID.load(post.userID);
Expand Down
1 change: 1 addition & 0 deletions apps/gql/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type PanoPost implements Node {
id: ID!
title: String!
url: String
site: String
content: String
createdAt: DateTime!
owner: User
Expand Down
2 changes: 2 additions & 0 deletions apps/gql/schema/types.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export type PanoPost = Node & {
createdAt: Scalars["DateTime"]["output"];
id: Scalars["ID"]["output"];
owner: Maybe<User>;
site: Maybe<Scalars["String"]["output"]>;
title: Scalars["String"]["output"];
url: Maybe<Scalars["String"]["output"]>;
};
Expand Down Expand Up @@ -434,6 +435,7 @@ export type PanoPostResolvers<
createdAt: Resolver<ResolversTypes["DateTime"], ParentType, ContextType>;
id: Resolver<ResolversTypes["ID"], ParentType, ContextType>;
owner: Resolver<Maybe<ResolversTypes["User"]>, ParentType, ContextType>;
site: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
title: Resolver<ResolversTypes["String"], ParentType, ContextType>;
url: Resolver<Maybe<ResolversTypes["String"]>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
Expand Down

0 comments on commit 3e3636d

Please sign in to comment.