Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(note): create note from quote #986

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading