-
Notifications
You must be signed in to change notification settings - Fork 2
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
Create TypeScript model for Notes Data API #479
Comments
Tom mentioned Paratext 9 Plugins' IProjectNote related to this |
From a quick search, GraphQL is a query language for describing how to get data from an API (like SQL). Why would we want to constrain our design to that specific query language? I feel like this is a step backwards from how we've designed our data access via actual method calls. It seems like a lot of complication to add for no gain in functionality. |
I am fine if we use GraphQL, but "This model must be written in GaphQL" should not be part of a use case description, and should not be a technical requirement given to the developers unless it is the only option. The developers on the project should decide the technology used. Perhaps GraphQL is the best technology, but in Scrum this should be left to the developers to decide how it is implemented since they are closest to the technical solution. They can receive feedback from stakeholders, product owner(s), and others outside the team, but it is there responsibility to determine the best way to do that. For example, if we are interfacing with an external system, and the only way to communicate with that system is via a certain protocol we should say that, but when there are multiple options to solve a problem then the developers should determine how to do that. |
Michael Marshall, who represents our funders, made this request
specifically about using GraphQL to define our APIs and our intended APIs.
I completely agree with your statement that the PO should not be defining
technologies to the dev team. But in this case GraphQL is the requirement
for the issue.
…-Glenn
*…………………………………*
[image: Paratext logo]
*Glenn Pruitt*
Paratext Product Manager
***@***.***
***@***.***>
On Mon, Sep 25, 2023 at 11:53 AM darren8c ***@***.***> wrote:
I am fine if we use GraphQL, but "This model must be written in GaphQL"
should not be part of a use case description, and should not be a technical
requirement given to the developers unless it is the only option. The
developers on the project should decide the technology used. Perhaps
GraphQL is the best technology, but in Scrum this should be left to the
developers to decide how it is implemented since they are closest to the
technical solution. They can receive feedback from stakeholders, product
owner(s), and others outside the team, but it is there responsibility to
determine the best way to do that.
For example, if we are interfacing with an external system, and the only
way to communicate with that system is via a certain protocol we should say
that, but when there are multiple options to solve a problem then the
developers should determine how to do that.
—
Reply to this email directly, view it on GitHub
<#479>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGT7LY7QTZ6237D6FXLRHZLX4GSHZANCNFSM6AAAAAA5AMIQTE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Adapted from the following in Paratext 9's Plugin Interface Docs:
Partial GraphQL implementation (abandoned)
# Represents a DateTimeOffset
scalar Date
# An object representing a project note
type ProjectNote {
# A selection in the Scripture text representing the "anchor" location of the note.
anchor: ScriptureTextSelection!
# Present in a note when it has been assigned to a particular user.
assignedUser: UserInfo
# The comments that comprise the note
comments: [Comment]!
# Flag indicating whether all the comments of the note have been read by the current user.
isRead: Boolean!
# Flag indicating whether this note is resolved.
isResolved: Boolean!
# Present in a note when it has been assigned to reply-to a particular user.
replyToUser: UserInfo
}
# A selection in the Scripture text
type ScriptureTextSelection {
# The raw USFM text following the SelectedText (typically the remainder of the verse represented by VerseRefEnd).
afterContext: String!
# The raw USFM text preceding the SelectedText (typically the entirety of the verse represented by VerseRefStart up to Offset).
beforeContext: String!
# The character offset (in the raw USFM data) starting from the point before the \v (i.e., the slash is the 0th character).
offset: Int!
# The selected text represented by this object. Can be an empty string (representing an insertion point).
selectedText: String!
# The verse where the selection ends.
verseRefEnd: VerseRef!
# The verse where the selection starts.
verseRefStart: VerseRef!
}
# An object representing information about a user
type UserInfo {
# Gets the registration name of the current user or an empty string if there is no registration information
name: String!
}
type VerseRef {
}
# An object representing a comment in a project note
type Comment {
# User to whom a comment is/was assigned.
assignedUser: UserInfo
# User who authored this comment
author: UserInfo!
# The list of paragraphs making up the contents of this comment.
contents: [CommentParagraph]
# Date/time this comment was created
created: Date!
# The language used in the comment (except where specified explicitly in a FormattedString).
language: Language
}
# An object representing a language definition
# SUBJECT TO CHANGE
type Language {
# Gets the default font.
font: Font
# Gets the IETF BCP-47 language tag.
id: String!
# Gets whether the language is displayed right-to-left.
isRtoL: Boolean!
}
# Object representing a font
# SUBJECT TO CHANGE
type Font {
# A comma-separated list of selected feature options for a Graphite font. REVIEW: Although Paratext does not seem to support selection of features for Open Type fonts, it's possible that existing LDML files may have this information and it could be used by Paratext (and therefore maybe passed on here).
features: String
# Name of the font family, which represents a group of fonts that have a similar font face.
fontFamily: String
# The language tag needed to tell a Graphite font which set of customized rules to use.
language: String
# The em-size measured in in points
size: Float
}
# Object representing a paragraph in a comment
# SUBJECT TO CHANGE DEPENDING ON HOW WE WANT TO MAKE RICH TEXT EDITING
type CommentParagraph {
# List of formatted text spans that make up the paragraph
spans: [FormattedString]
}
# A span of text that has formatting specified.
# SUBJECT TO CHANGE DEPENDING ON HOW WE WANT TO MAKE RICH TEXT EDITING
type FormattedString {
# The language in which the text is written. If null, the language is the Comment.Language of the owning comment.
language: Language
# Flags indicating the style
style: Style!
# The text of the string. Cannot be null or empty.
text: String!
}
# Indicates which styles are applied on a FormattedString.
# SUBJECT TO CHANGE DEPENDING ON HOW WE WANT TO MAKE RICH TEXT EDITING
enum Style {
# Includes bold formatting
Bold
# Includes italics formatting
Italic
# No special formatting
Plain
} |
Relied heavily on IProject and IProjectNote to create the types. First draft: Notes for ease of reading:
|
Added in #538 |
Some thoughts from Matt to discuss sometime with Tim, particularly regarding figuring out what all we can do to the api and still work with PT9:
Note: most of ProjectNote (everything but |
Follow-up changes: Note: we can use |
As a funder I want to have a description of all APIs in the BT space. Specifically, I want a model of the API for Project Notes Data that will be exposed by Platform.Bible to extension developers. This model must be written in an easy-to-read format (previously GraphQL).
Only needs to be done for publicly available APIs (aka ones that can be consumed by an extension)
Write documentation for the Project Notes Data API.
Talk to Michael Marshall for more details.
The text was updated successfully, but these errors were encountered: