Revert "Make PublicUserNode the default instead of PrivateUserNode"
This reverts commit 3b67f8a156.
This commit is contained in:
parent
3b67f8a156
commit
2ea76918eb
|
|
@ -262,7 +262,7 @@ export type AnswerNode = Node & {
|
|||
data: Scalars['JSONString']['output'];
|
||||
/** The ID of the object */
|
||||
id: Scalars['ID']['output'];
|
||||
owner: PublicUserNode;
|
||||
owner: PrivateUserNode;
|
||||
pk?: Maybe<Scalars['Int']['output']>;
|
||||
survey: SurveyNode;
|
||||
};
|
||||
|
|
@ -313,7 +313,7 @@ export type AssignmentNode = Node & {
|
|||
id: Scalars['ID']['output'];
|
||||
modified: Scalars['DateTime']['output'];
|
||||
module: ModuleNode;
|
||||
owner?: Maybe<PublicUserNode>;
|
||||
owner?: Maybe<PrivateUserNode>;
|
||||
path: Scalars['String']['output'];
|
||||
solution?: Maybe<Scalars['String']['output']>;
|
||||
submission?: Maybe<StudentSubmissionNode>;
|
||||
|
|
@ -349,7 +349,7 @@ export type ChapterBookmarkNode = Node & {
|
|||
id: Scalars['ID']['output'];
|
||||
note?: Maybe<NoteNode>;
|
||||
path?: Maybe<Scalars['String']['output']>;
|
||||
user: PublicUserNode;
|
||||
user: PrivateUserNode;
|
||||
};
|
||||
|
||||
export type ChapterBookmarkNodeConnection = {
|
||||
|
|
@ -439,7 +439,7 @@ export type ContentBlockBookmarkNode = Node & {
|
|||
id: Scalars['ID']['output'];
|
||||
note?: Maybe<NoteNode>;
|
||||
path?: Maybe<Scalars['String']['output']>;
|
||||
user: PublicUserNode;
|
||||
user: PrivateUserNode;
|
||||
uuid?: Maybe<Scalars['UUID']['output']>;
|
||||
};
|
||||
|
||||
|
|
@ -770,7 +770,7 @@ export type HighlightNode = Node & {
|
|||
selectionLength: Scalars['Int']['output'];
|
||||
startPosition: Scalars['Int']['output'];
|
||||
text: Scalars['String']['output'];
|
||||
user: PublicUserNode;
|
||||
user: PrivateUserNode;
|
||||
};
|
||||
|
||||
export type HighlightableNode = ChapterNode | ContentBlockNode | InstrumentNode | ModuleNode;
|
||||
|
|
@ -796,7 +796,7 @@ export type InstrumentBookmarkNode = Node & {
|
|||
instrument: InstrumentNode;
|
||||
note?: Maybe<NoteNode>;
|
||||
path: Scalars['String']['output'];
|
||||
user: PublicUserNode;
|
||||
user: PrivateUserNode;
|
||||
uuid?: Maybe<Scalars['UUID']['output']>;
|
||||
};
|
||||
|
||||
|
|
@ -899,7 +899,7 @@ export type ModuleBookmarkNode = {
|
|||
module: ModuleNode;
|
||||
note?: Maybe<NoteNode>;
|
||||
path?: Maybe<Scalars['String']['output']>;
|
||||
user: PublicUserNode;
|
||||
user: PrivateUserNode;
|
||||
};
|
||||
|
||||
export type ModuleCategoryNode = Node & {
|
||||
|
|
@ -1519,7 +1519,7 @@ export type ObjectiveNode = Node & {
|
|||
id: Scalars['ID']['output'];
|
||||
mine?: Maybe<Scalars['Boolean']['output']>;
|
||||
order?: Maybe<Scalars['Int']['output']>;
|
||||
owner?: Maybe<PublicUserNode>;
|
||||
owner?: Maybe<PrivateUserNode>;
|
||||
pk?: Maybe<Scalars['Int']['output']>;
|
||||
text: Scalars['String']['output'];
|
||||
userCreated?: Maybe<Scalars['Boolean']['output']>;
|
||||
|
|
@ -1655,10 +1655,11 @@ export type ProjectNode = Node & {
|
|||
/** The ID of the object */
|
||||
id: Scalars['ID']['output'];
|
||||
objectives: Scalars['String']['output'];
|
||||
owner?: Maybe<PublicUserNode>;
|
||||
pk?: Maybe<Scalars['Int']['output']>;
|
||||
schoolClass?: Maybe<SchoolClassNode>;
|
||||
slug: Scalars['String']['output'];
|
||||
student?: Maybe<PublicUserNode>;
|
||||
student: PrivateUserNode;
|
||||
title: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
|
|
@ -2124,7 +2125,7 @@ export type StudentSubmissionNode = Node & {
|
|||
/** The ID of the object */
|
||||
id: Scalars['ID']['output'];
|
||||
modified: Scalars['DateTime']['output'];
|
||||
student: PublicUserNode;
|
||||
student: PrivateUserNode;
|
||||
submissionFeedback?: Maybe<SubmissionFeedbackNode>;
|
||||
text: Scalars['String']['output'];
|
||||
};
|
||||
|
|
@ -2144,7 +2145,7 @@ export type SubmissionFeedbackNode = Node & {
|
|||
id: Scalars['ID']['output'];
|
||||
modified: Scalars['DateTime']['output'];
|
||||
studentSubmission: StudentSubmissionNode;
|
||||
teacher: PublicUserNode;
|
||||
teacher: PrivateUserNode;
|
||||
text: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
|
|
@ -2212,7 +2213,7 @@ export type SyncModuleVisibilityPayload = {
|
|||
export type TeamNode = Node & {
|
||||
__typename?: 'TeamNode';
|
||||
code?: Maybe<Scalars['String']['output']>;
|
||||
creator: PublicUserNode;
|
||||
creator?: Maybe<PrivateUserNode>;
|
||||
/** The ID of the object */
|
||||
id: Scalars['ID']['output'];
|
||||
isDeleted: Scalars['Boolean']['output'];
|
||||
|
|
@ -2694,7 +2695,7 @@ export type ReadOnlyQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
|||
|
||||
export type ReadOnlyQueryQuery = { __typename?: 'Query', me?: { __typename?: 'PrivateUserNode', readOnly?: boolean | null, selectedClass?: { __typename?: 'SchoolClassNode', readOnly?: boolean | null } | null } | null };
|
||||
|
||||
export type SubmissionPartsFragment = { __typename?: 'StudentSubmissionNode', id: string, text: string, final: boolean, document: string, submissionFeedback?: { __typename?: 'SubmissionFeedbackNode', id: string, text: string, teacher: { __typename?: 'PublicUserNode', firstName: string, lastName: string } } | null } & { ' $fragmentName'?: 'SubmissionPartsFragment' };
|
||||
export type SubmissionPartsFragment = { __typename?: 'StudentSubmissionNode', id: string, text: string, final: boolean, document: string, submissionFeedback?: { __typename?: 'SubmissionFeedbackNode', id: string, text: string, teacher: { __typename?: 'PrivateUserNode', firstName: string, lastName: string } } | null } & { ' $fragmentName'?: 'SubmissionPartsFragment' };
|
||||
|
||||
export type AssignmentPartsFragment = { __typename?: 'AssignmentNode', id: string, title: string, assignment: string, solution?: string | null, submission?: (
|
||||
{ __typename?: 'StudentSubmissionNode' }
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from graphene_django import DjangoObjectType
|
|||
|
||||
from api.utils import get_by_id_or_slug
|
||||
from portfolio.models import Project, ProjectEntry
|
||||
from users.models import Role, UserRole
|
||||
from users.models import Role, UserRole, User
|
||||
from users.schema import PublicUserNode
|
||||
|
||||
|
||||
|
|
@ -13,18 +13,18 @@ class ProjectEntryNode(DjangoObjectType):
|
|||
class Meta:
|
||||
model = ProjectEntry
|
||||
interfaces = (relay.Node,)
|
||||
fields = ("description", "document_url", "project", "created")
|
||||
fields = ('description', 'document_url', 'project', 'created')
|
||||
|
||||
|
||||
class ProjectNode(DjangoObjectType):
|
||||
pk = graphene.Int()
|
||||
entries_count = graphene.Int()
|
||||
entries = graphene.List(ProjectEntryNode)
|
||||
student = graphene.Field(PublicUserNode)
|
||||
owner = graphene.Field(PublicUserNode)
|
||||
|
||||
class Meta:
|
||||
model = Project
|
||||
filter_fields = ["slug", "appearance"]
|
||||
filter_fields = ['slug', 'appearance']
|
||||
interfaces = (relay.Node,)
|
||||
|
||||
def resolve_pk(self, *args, **kwargs):
|
||||
|
|
@ -45,16 +45,11 @@ class PortfolioQuery(object):
|
|||
def resolve_projects(self, info, **kwargs):
|
||||
user = info.context.user
|
||||
if user.is_superuser:
|
||||
return Project.objects.all().order_by("-pk")
|
||||
return Project.objects.all().order_by('-pk')
|
||||
|
||||
if (
|
||||
UserRole.get_role_for_user(user).role
|
||||
== Role.objects.get_default_teacher_role()
|
||||
):
|
||||
return Project.objects.filter(
|
||||
Q(student__school_classes__in=user.school_classes.all(), final=True)
|
||||
| Q(student=user, final=False)
|
||||
).distinct()
|
||||
if UserRole.get_role_for_user(user).role == Role.objects.get_default_teacher_role():
|
||||
return Project.objects.filter(Q(student__school_classes__in=user.school_classes.all(), final=True) |
|
||||
Q(student=user, final=False)).distinct()
|
||||
|
||||
return Project.objects.filter(student=user)
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ type TopicNode implements Node {
|
|||
type HighlightNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
user: PublicUserNode!
|
||||
user: PrivateUserNode!
|
||||
page: HighlightableNode!
|
||||
contentIndex: Int
|
||||
contentUuid: UUID
|
||||
|
|
@ -182,193 +182,43 @@ type HighlightNode implements Node {
|
|||
color: String!
|
||||
}
|
||||
|
||||
type PublicUserNode implements Node {
|
||||
type PrivateUserNode implements Node {
|
||||
firstName: String!
|
||||
lastName: String!
|
||||
avatarUrl: String!
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
fullName: String!
|
||||
isMe: Boolean
|
||||
}
|
||||
|
||||
union HighlightableNode = ContentBlockNode | InstrumentNode | ModuleNode | ChapterNode
|
||||
|
||||
type ContentBlockNode implements Node & ContentBlockInterface {
|
||||
title: String
|
||||
|
||||
"""
|
||||
Der Name der Seite, wie er in URLs angezeigt werden soll, z.B. http://domain.com/blog/[my-slug]/
|
||||
Erforderlich. 150 Zeichen oder weniger. Nur Buchstaben, Ziffern und @/./+/-/_.
|
||||
"""
|
||||
slug: String!
|
||||
hiddenFor: [SchoolClassNode]
|
||||
visibleFor: [SchoolClassNode]
|
||||
userCreated: Boolean!
|
||||
contents: GenericStreamFieldType
|
||||
type: String!
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
mine: Boolean
|
||||
bookmarks: [ContentBlockBookmarkNode]
|
||||
originalCreator: PublicUserNode
|
||||
instrumentCategory: InstrumentCategoryNode
|
||||
path: String
|
||||
highlights: [HighlightNode]
|
||||
}
|
||||
|
||||
interface ContentBlockInterface {
|
||||
title: String
|
||||
contents: GenericStreamFieldType
|
||||
type: String!
|
||||
}
|
||||
|
||||
scalar GenericStreamFieldType
|
||||
|
||||
type SchoolClassNode implements Node {
|
||||
name: String!
|
||||
code: String
|
||||
username: String!
|
||||
lastModule: ModuleNode
|
||||
lastModuleLevel: ModuleLevelNode
|
||||
lastTopic: TopicNode
|
||||
email: String!
|
||||
onboardingVisited: Boolean!
|
||||
team: TeamNode
|
||||
schoolClasses: [SchoolClassNode]
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
pk: Int
|
||||
members: [ClassMemberNode]
|
||||
readOnly: Boolean
|
||||
}
|
||||
|
||||
"""
|
||||
We need to build this ourselves, because we want the active property on the node, because providing it on the
|
||||
Connection or Edge for a UserNodeConnection is difficult.
|
||||
"""
|
||||
type ClassMemberNode {
|
||||
user: PublicUserNode
|
||||
active: Boolean
|
||||
firstName: String
|
||||
lastName: String
|
||||
permissions: [String]
|
||||
selectedClass: SchoolClassNode
|
||||
expiryDate: String
|
||||
isTeacher: Boolean
|
||||
id: ID
|
||||
isMe: Boolean
|
||||
}
|
||||
oldClasses: [SchoolClassNode]
|
||||
recentModules(
|
||||
offset: Int
|
||||
before: String
|
||||
after: String
|
||||
first: Int
|
||||
last: Int
|
||||
recentModules: ID
|
||||
|
||||
type ContentBlockBookmarkNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
user: PublicUserNode!
|
||||
note: NoteNode
|
||||
uuid: UUID
|
||||
contentBlock: ContentBlockNode!
|
||||
path: String
|
||||
content: String
|
||||
}
|
||||
|
||||
type NoteNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
text: String!
|
||||
contentblockbookmark: ContentBlockBookmarkNode
|
||||
modulebookmark: ModuleBookmarkNode
|
||||
chapterbookmark: ChapterBookmarkNode
|
||||
instrumentbookmark: InstrumentBookmarkNode
|
||||
highlight: HighlightNode
|
||||
pk: Int
|
||||
}
|
||||
|
||||
type ModuleBookmarkNode {
|
||||
id: ID!
|
||||
user: PublicUserNode!
|
||||
note: NoteNode
|
||||
module: ModuleNode!
|
||||
path: String
|
||||
content: String
|
||||
}
|
||||
|
||||
type ChapterBookmarkNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
user: PublicUserNode!
|
||||
note: NoteNode
|
||||
chapter: ChapterNode!
|
||||
path: String
|
||||
content: String
|
||||
}
|
||||
|
||||
type ChapterNode implements Node & ChapterInterface {
|
||||
title: String
|
||||
|
||||
"""
|
||||
Der Name der Seite, wie er in URLs angezeigt werden soll, z.B. http://domain.com/blog/[my-slug]/
|
||||
"""
|
||||
slug: String!
|
||||
description: String
|
||||
titleHiddenFor: [SchoolClassNode]
|
||||
descriptionHiddenFor: [SchoolClassNode]
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
bookmark: ChapterBookmarkNode
|
||||
contentBlocks: [ContentBlockNode]
|
||||
path: String
|
||||
highlights: [HighlightNode]
|
||||
}
|
||||
|
||||
interface ChapterInterface {
|
||||
description: String
|
||||
title: String
|
||||
}
|
||||
|
||||
type InstrumentBookmarkNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
user: PublicUserNode!
|
||||
note: NoteNode
|
||||
uuid: UUID
|
||||
instrument: InstrumentNode!
|
||||
path: String!
|
||||
content: String
|
||||
}
|
||||
|
||||
"""
|
||||
Leverages the internal Python implementation of UUID (uuid.UUID) to provide native UUID objects
|
||||
in fields, resolvers and input.
|
||||
"""
|
||||
scalar UUID
|
||||
|
||||
type InstrumentNode implements Node {
|
||||
"""Der Seitentitel, der öffentlich angezeigt werden soll"""
|
||||
title: String!
|
||||
|
||||
"""
|
||||
Der Name der Seite, wie er in URLs angezeigt werden soll, z.B. http://domain.com/blog/[my-slug]/
|
||||
"""
|
||||
slug: String!
|
||||
intro: String!
|
||||
contents: GenericStreamFieldType
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
bookmarks: [InstrumentBookmarkNode]
|
||||
type: InstrumentTypeNode
|
||||
language: String
|
||||
highlights: [HighlightNode!]!
|
||||
path: String!
|
||||
}
|
||||
|
||||
type InstrumentTypeNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
name: String!
|
||||
category: InstrumentCategoryNode
|
||||
type: String!
|
||||
}
|
||||
|
||||
type InstrumentCategoryNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
name: String!
|
||||
background: String!
|
||||
foreground: String!
|
||||
types: [InstrumentTypeNode]
|
||||
"""Sortierung"""
|
||||
orderBy: String
|
||||
): ModuleNodeConnection
|
||||
readOnly: Boolean
|
||||
}
|
||||
|
||||
type ModuleLevelNode implements Node {
|
||||
|
|
@ -425,6 +275,206 @@ type ModuleNodeEdge {
|
|||
cursor: String!
|
||||
}
|
||||
|
||||
type TeamNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
name: String!
|
||||
isDeleted: Boolean!
|
||||
code: String
|
||||
creator: PrivateUserNode
|
||||
members: [PublicUserNode]
|
||||
pk: Int
|
||||
}
|
||||
|
||||
type PublicUserNode implements Node {
|
||||
firstName: String!
|
||||
lastName: String!
|
||||
avatarUrl: String!
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
fullName: String!
|
||||
isMe: Boolean
|
||||
}
|
||||
|
||||
type SchoolClassNode implements Node {
|
||||
name: String!
|
||||
code: String
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
pk: Int
|
||||
members: [ClassMemberNode]
|
||||
readOnly: Boolean
|
||||
}
|
||||
|
||||
"""
|
||||
We need to build this ourselves, because we want the active property on the node, because providing it on the
|
||||
Connection or Edge for a UserNodeConnection is difficult.
|
||||
"""
|
||||
type ClassMemberNode {
|
||||
user: PublicUserNode
|
||||
active: Boolean
|
||||
firstName: String
|
||||
lastName: String
|
||||
isTeacher: Boolean
|
||||
id: ID
|
||||
isMe: Boolean
|
||||
}
|
||||
|
||||
union HighlightableNode = ContentBlockNode | InstrumentNode | ModuleNode | ChapterNode
|
||||
|
||||
type ContentBlockNode implements Node & ContentBlockInterface {
|
||||
title: String
|
||||
|
||||
"""
|
||||
Der Name der Seite, wie er in URLs angezeigt werden soll, z.B. http://domain.com/blog/[my-slug]/
|
||||
"""
|
||||
slug: String!
|
||||
hiddenFor: [SchoolClassNode]
|
||||
visibleFor: [SchoolClassNode]
|
||||
userCreated: Boolean!
|
||||
contents: GenericStreamFieldType
|
||||
type: String!
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
mine: Boolean
|
||||
bookmarks: [ContentBlockBookmarkNode]
|
||||
originalCreator: PublicUserNode
|
||||
instrumentCategory: InstrumentCategoryNode
|
||||
path: String
|
||||
highlights: [HighlightNode]
|
||||
}
|
||||
|
||||
interface ContentBlockInterface {
|
||||
title: String
|
||||
contents: GenericStreamFieldType
|
||||
type: String!
|
||||
}
|
||||
|
||||
scalar GenericStreamFieldType
|
||||
|
||||
type ContentBlockBookmarkNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
user: PrivateUserNode!
|
||||
note: NoteNode
|
||||
uuid: UUID
|
||||
contentBlock: ContentBlockNode!
|
||||
path: String
|
||||
content: String
|
||||
}
|
||||
|
||||
type NoteNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
text: String!
|
||||
contentblockbookmark: ContentBlockBookmarkNode
|
||||
modulebookmark: ModuleBookmarkNode
|
||||
chapterbookmark: ChapterBookmarkNode
|
||||
instrumentbookmark: InstrumentBookmarkNode
|
||||
highlight: HighlightNode
|
||||
pk: Int
|
||||
}
|
||||
|
||||
type ModuleBookmarkNode {
|
||||
id: ID!
|
||||
user: PrivateUserNode!
|
||||
note: NoteNode
|
||||
module: ModuleNode!
|
||||
path: String
|
||||
content: String
|
||||
}
|
||||
|
||||
type ChapterBookmarkNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
user: PrivateUserNode!
|
||||
note: NoteNode
|
||||
chapter: ChapterNode!
|
||||
path: String
|
||||
content: String
|
||||
}
|
||||
|
||||
type ChapterNode implements Node & ChapterInterface {
|
||||
title: String
|
||||
|
||||
"""
|
||||
Der Name der Seite, wie er in URLs angezeigt werden soll, z.B. http://domain.com/blog/[my-slug]/
|
||||
"""
|
||||
slug: String!
|
||||
description: String
|
||||
titleHiddenFor: [SchoolClassNode]
|
||||
descriptionHiddenFor: [SchoolClassNode]
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
bookmark: ChapterBookmarkNode
|
||||
contentBlocks: [ContentBlockNode]
|
||||
path: String
|
||||
highlights: [HighlightNode]
|
||||
}
|
||||
|
||||
interface ChapterInterface {
|
||||
description: String
|
||||
title: String
|
||||
}
|
||||
|
||||
type InstrumentBookmarkNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
user: PrivateUserNode!
|
||||
note: NoteNode
|
||||
uuid: UUID
|
||||
instrument: InstrumentNode!
|
||||
path: String!
|
||||
content: String
|
||||
}
|
||||
|
||||
"""
|
||||
Leverages the internal Python implementation of UUID (uuid.UUID) to provide native UUID objects
|
||||
in fields, resolvers and input.
|
||||
"""
|
||||
scalar UUID
|
||||
|
||||
type InstrumentNode implements Node {
|
||||
"""Der Seitentitel, der öffentlich angezeigt werden soll"""
|
||||
title: String!
|
||||
|
||||
"""
|
||||
Der Name der Seite, wie er in URLs angezeigt werden soll, z.B. http://domain.com/blog/[my-slug]/
|
||||
"""
|
||||
slug: String!
|
||||
intro: String!
|
||||
contents: GenericStreamFieldType
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
bookmarks: [InstrumentBookmarkNode]
|
||||
type: InstrumentTypeNode
|
||||
language: String
|
||||
highlights: [HighlightNode!]!
|
||||
path: String!
|
||||
}
|
||||
|
||||
type InstrumentTypeNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
name: String!
|
||||
category: InstrumentCategoryNode
|
||||
type: String!
|
||||
}
|
||||
|
||||
type InstrumentCategoryNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
name: String!
|
||||
background: String!
|
||||
foreground: String!
|
||||
types: [InstrumentTypeNode]
|
||||
}
|
||||
|
||||
type ModuleCategoryNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
|
|
@ -454,7 +504,7 @@ type AssignmentNode implements Node {
|
|||
assignment: String!
|
||||
solution: String
|
||||
deleted: Boolean!
|
||||
owner: PublicUserNode
|
||||
owner: PrivateUserNode
|
||||
module: ModuleNode!
|
||||
userCreated: Boolean!
|
||||
taskbaseId: String
|
||||
|
|
@ -478,7 +528,7 @@ type StudentSubmissionNode implements Node {
|
|||
text: String!
|
||||
document: String!
|
||||
assignment: AssignmentNode!
|
||||
student: PublicUserNode!
|
||||
student: PrivateUserNode!
|
||||
final: Boolean!
|
||||
submissionFeedback: SubmissionFeedbackNode
|
||||
}
|
||||
|
|
@ -487,7 +537,7 @@ type SubmissionFeedbackNode implements Node {
|
|||
created: DateTime!
|
||||
modified: DateTime!
|
||||
text: String!
|
||||
teacher: PublicUserNode!
|
||||
teacher: PrivateUserNode!
|
||||
studentSubmission: StudentSubmissionNode!
|
||||
final: Boolean!
|
||||
|
||||
|
|
@ -523,7 +573,7 @@ type ObjectiveNode implements Node {
|
|||
id: ID!
|
||||
text: String!
|
||||
group: ObjectiveGroupNode!
|
||||
owner: PublicUserNode
|
||||
owner: PrivateUserNode
|
||||
hiddenFor: [SchoolClassNode]
|
||||
visibleFor: [SchoolClassNode]
|
||||
order: Int
|
||||
|
|
@ -647,7 +697,7 @@ type SnapshotChangesNode {
|
|||
type AnswerNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
owner: PublicUserNode!
|
||||
owner: PrivateUserNode!
|
||||
data: JSONString!
|
||||
survey: SurveyNode!
|
||||
pk: Int
|
||||
|
|
@ -739,12 +789,13 @@ type ProjectNode implements Node {
|
|||
slug: String!
|
||||
objectives: String!
|
||||
appearance: String!
|
||||
student: PublicUserNode
|
||||
student: PrivateUserNode!
|
||||
final: Boolean!
|
||||
schoolClass: SchoolClassNode
|
||||
entries: [ProjectEntryNode]
|
||||
pk: Int
|
||||
entriesCount: Int
|
||||
owner: PublicUserNode
|
||||
}
|
||||
|
||||
type ProjectEntryNode implements Node {
|
||||
|
|
@ -889,55 +940,6 @@ type CommentNode implements Node {
|
|||
id: ID!
|
||||
}
|
||||
|
||||
type PrivateUserNode implements Node {
|
||||
"""
|
||||
Erforderlich. 150 Zeichen oder weniger. Nur Buchstaben, Ziffern und @/./+/-/_.
|
||||
"""
|
||||
username: String!
|
||||
firstName: String!
|
||||
lastName: String!
|
||||
lastModule: ModuleNode
|
||||
lastModuleLevel: ModuleLevelNode
|
||||
lastTopic: TopicNode
|
||||
avatarUrl: String!
|
||||
email: String!
|
||||
onboardingVisited: Boolean!
|
||||
team: TeamNode
|
||||
schoolClasses: [SchoolClassNode]
|
||||
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
pk: Int
|
||||
permissions: [String]
|
||||
selectedClass: SchoolClassNode
|
||||
expiryDate: String
|
||||
isTeacher: Boolean
|
||||
oldClasses: [SchoolClassNode]
|
||||
recentModules(
|
||||
offset: Int
|
||||
before: String
|
||||
after: String
|
||||
first: Int
|
||||
last: Int
|
||||
recentModules: ID
|
||||
|
||||
"""Sortierung"""
|
||||
orderBy: String
|
||||
): ModuleNodeConnection
|
||||
readOnly: Boolean
|
||||
}
|
||||
|
||||
type TeamNode implements Node {
|
||||
"""The ID of the object"""
|
||||
id: ID!
|
||||
name: String!
|
||||
isDeleted: Boolean!
|
||||
code: String
|
||||
creator: PublicUserNode
|
||||
members: [PublicUserNode]
|
||||
pk: Int
|
||||
}
|
||||
|
||||
type PrivateUserNodeConnection {
|
||||
"""Pagination data for this connection."""
|
||||
pageInfo: PageInfo!
|
||||
|
|
|
|||
|
|
@ -70,6 +70,20 @@ class TeamNode(DjangoObjectType):
|
|||
return self.members.all()
|
||||
|
||||
|
||||
class PublicUserNode(DjangoObjectType):
|
||||
full_name = graphene.String(required=True)
|
||||
is_me = graphene.Boolean()
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
only_fields = ["full_name", "first_name", "last_name", "avatar_url"]
|
||||
interfaces = (relay.Node,)
|
||||
|
||||
@staticmethod
|
||||
def resolve_is_me(parent: User, info, **kwargs):
|
||||
return info.context.user.pk == parent.pk
|
||||
|
||||
|
||||
class PrivateUserNode(DjangoObjectType):
|
||||
class Meta:
|
||||
model = User
|
||||
|
|
@ -154,20 +168,6 @@ class PrivateUserNode(DjangoObjectType):
|
|||
return self.team
|
||||
|
||||
|
||||
class PublicUserNode(DjangoObjectType):
|
||||
full_name = graphene.String(required=True)
|
||||
is_me = graphene.Boolean()
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
only_fields = ["full_name", "first_name", "last_name", "avatar_url"]
|
||||
interfaces = (relay.Node,)
|
||||
|
||||
@staticmethod
|
||||
def resolve_is_me(parent: User, info, **kwargs):
|
||||
return info.context.user.pk == parent.pk
|
||||
|
||||
|
||||
class ClassMemberNode(ObjectType):
|
||||
"""
|
||||
We need to build this ourselves, because we want the active property on the node, because providing it on the
|
||||
|
|
|
|||
Loading…
Reference in New Issue