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

Add users #172

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
66 changes: 41 additions & 25 deletions packages/subgraph/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,37 +1,53 @@
type Article @entity {
id: ID!
publication: Publication!
poster: Bytes! # message sender for article creation event
article: String! # markdown formatted string or IPFS hash
authors: [String!] # array of authors (address or string name)
postedOn: BigInt! # unix timestamp of original article
lastUpdated: BigInt! # unix timestamp of last update
tags: [String!] # array of tags
title: String! # title of the article
description: String # description of the article
image: String # IPFS hash (pointing to a image) or a BASE64 encoded image string
poster: Bytes! # message sender for article creation event.
article: String! # markdown formatted string or IPFS hash.
authors: [String!] # array of authors (chain specific address or name).
postedOn: BigInt! # unix timestamp of original article.
lastUpdated: BigInt! # unix timestamp of last update.
tags: [String!] # array of tags.
title: String! # title of the article.
description: String # description of the article.
image: String # IPFS hash (pointing to a image) or a BASE64 encoded image string.
}

type Publication @entity {
id: ID!
title: String! # title of the publication
description: String
image: String # IPFS hash (pointing to a image) or a BASE64 encoded image string
tags: [String!] # array of tags
articles: [Article!]! # articles in this publication
permissions: [Permission!]! # permissions in this publication
createdOn: BigInt! # unix timestamp
lastUpdated: BigInt! # unix timestamp
title: String! # title of the publication.
description: String # short description of the publication.
link: String # a URL to be displayed on the publication profile
twitter: String # the publication's twitter profile
github: String # the publication's github profile
discord: String # an invite link to the publication's discord
image: String # IPFS hash (pointing to an image) or a BASE64 encoded image string.
tags: [String!] # array of tags.
articles: [Article!]! # articles in this publication.
permissions: [Permission!]! # permissions in this publication.
createdOn: BigInt! # unix timestamp.
lastUpdated: BigInt! # unix timestamp.
}

type Permission @entity {
id: ID!
publication: Publication!
address: Bytes!
articleCreate: Boolean
articleUpdate: Boolean
articleDelete: Boolean
publicationUpdate: Boolean
publicationDelete: Boolean
publicationPermissions: Boolean
publication: Publication! # the publication in which these permissions are held.
address: Bytes! # user address.
articleCreate: Boolean # can create new articles in this publication.
articleUpdate: Boolean # can modify existing articles in this publication.
articleDelete: Boolean # can delete existing articles in this publication.
publicationUpdate: Boolean # can modify this publication.
publicationDelete: Boolean # can delete this publication, along with all of its articles.
publicationPermissions: Boolean # can modify permissions in this publication.
}

type User @entity {
id: ID! # could be either a chain specific address, for a default user profile, or the concatenation of a chain specific address and a publication ID for a publication specific profile.
displayName: String # this user's chosen display name.
profilePicture: String # IPFS hash (pointing to an image) or a BASE64 encoded image string.
link: String # a link to be displayed on the user's profile
twitter: String # user's twitter handle
github: String # user's github handle
permissions: [Permission!]! # permissions that this user holds.
articles: [Article!]! # articles on which this user is listed as an author.
publications: [Publication!]! # publications in which the user has approved themself to be listed as an author.
}