Skip to content

Commit

Permalink
enh(core): add content highlighted in the snippet schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tericcabrel committed Nov 1, 2023
1 parent d0ad6c9 commit 3f967f6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/core/src/resources/schema.graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default gql`
id: ID!
name: String!
content: String!
contentHighlighted: String
shortContent: String!
language: String!
lineHighlight: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const createSnippet: MutationResolvers['createSnippet'] = async (_parent,

const createSnippetDto = new CreateSnippetDto({
content: input.content,
contentHighlighted: input.contentHighlighted,
description: input.description ?? null,
folderId: input.folderId,
language: input.language,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const updateSnippet: MutationResolvers['updateSnippet'] = async (_parent,

const updateSnippetDto = new UpdateSnippetDto({
content: input.content,
contentHighlighted: input.contentHighlighted,
creatorId: userId,
description: input.description ?? null,
language: input.language,
Expand Down
2 changes: 2 additions & 0 deletions apps/core/src/resources/snippets/schema.graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default gql`
folderId: String!
name: String!
content: String!
contentHighlighted: String!
language: String!
lineHighlight: String
visibility: SnippetVisibility!
Expand All @@ -27,6 +28,7 @@ export default gql`
input UpdateSnippetInput {
name: String!
content: String!
contentHighlighted: String!
language: String!
lineHighlight: String
visibility: SnippetVisibility!
Expand Down
4 changes: 4 additions & 0 deletions apps/core/src/types/graphql.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type CreateFolderInput = {

export type CreateSnippetInput = {
content: Scalars['String'];
contentHighlighted: Scalars['String'];
description?: InputMaybe<Scalars['String']>;
folderId: Scalars['String'];
language: Scalars['String'];
Expand Down Expand Up @@ -209,6 +210,7 @@ export type SignupUserResult = {
export type Snippet = {
__typename?: 'Snippet';
content: Scalars['String'];
contentHighlighted?: Maybe<Scalars['String']>;
createdAt: Scalars['Date'];
description?: Maybe<Scalars['String']>;
folder: Folder;
Expand Down Expand Up @@ -242,6 +244,7 @@ export type UpdateFolderInput = {

export type UpdateSnippetInput = {
content: Scalars['String'];
contentHighlighted: Scalars['String'];
description?: InputMaybe<Scalars['String']>;
language: Scalars['String'];
lineHighlight?: InputMaybe<Scalars['String']>;
Expand Down Expand Up @@ -586,6 +589,7 @@ export type SnippetResolvers<
ParentType extends ResolversParentTypes['Snippet'] = ResolversParentTypes['Snippet'],
> = {
content?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
contentHighlighted?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
createdAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
folder?: Resolver<ResolversTypes['Folder'], ParentType, ContextType>;
Expand Down

0 comments on commit 3f967f6

Please sign in to comment.