Skip to content

Commit

Permalink
feat(note): create note from quote (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
kschelonka authored Dec 2, 2024
1 parent dee79c4 commit 05e9e6a
Show file tree
Hide file tree
Showing 11 changed files with 687 additions and 42 deletions.
87 changes: 59 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions servers/notes-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
"prisma": "5.21.1",
"prosemirror-markdown": "1.13.1",
"prosemirror-model": "1.23.0",
"prosemirror-state": "1.4.3",
"prosemirror-transform": "1.10.2",
"tslib": "2.8.0",
"uuid": "^10.0.0"
},
Expand Down
38 changes: 38 additions & 0 deletions servers/notes-api/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,48 @@ input CreateNoteInput {
createdAt: ISOString
}

"""
Input to create a new Note seeded with copied content from a page.
The entire content becomes editable and is not able to be "reattached"
like a traditional highlight.
"""
input CreateNoteFromQuoteInput {
"""Optional title for this Note"""
title: String
"""
Client-provided UUID for the new Note.
If not provided, will be generated on the server.
"""
id: ID
"""
The Web Resource where the quote is taken from.
This should always be sent by the client where possible,
but in some cases (e.g. copying from mobile apps) there may
not be an accessible source url.
"""
source: ValidUrl
"""
JSON representation of a ProseMirror document, which
contains the formatted snipped text. This is used to seed
the initial Note document state, and will become editable.
"""
quote: ProseMirrorJson!
"""
When this note was created. If not provided, defaults to server time upon
receiving request.
"""
createdAt: ISOString
}


type Mutation {
"""
Create a new note, optionally with title and content
"""
createNote(input: CreateNoteInput!): Note! @requiresScopes(scopes: [["ROLE_USER"]])
"""
Create a new note, with a pre-populated block that contains the quoted and cited text
selected by a user.
"""
createNoteFromQuote(input: CreateNoteFromQuoteInput!): Note! @requiresScopes(scopes: [["ROLE_USER"]])
}
Loading

0 comments on commit 05e9e6a

Please sign in to comment.