Eduflow
Search…
Tags
Instructors can create course tags and assign them to students. Tags are used in features like activity subsetting or groups.
A tag belongs to a single course but a course can have multiple tags. Tags and students are a many-to-many relationship.

Querying

Course tags

Course tags can be listed by using the Course.tags field. This returns a list of Tag models that contain information like label, color or the assigned students. For more details, check out the Tag model in the API Reference.
The Tag.students field is a GraphQL connection. Read how to paginate a connection in the dedicated guide.
Query
Response
1
{
2
course(id: "00000000-5945-95c7-65fc-a9747b200320") {
3
tags {
4
label
5
color
6
students {
7
edges {
8
node {
9
name
10
email
11
}
12
}
13
}
14
}
15
}
16
}
17
Copied!
1
{
2
"data": {
3
"course": {
4
"tags": [
5
{
6
"label": "Stark",
7
"color": "#EB5757FF",
8
"students": {
9
"edges": [
10
{
11
"node": {
12
"name": "Sansa Stark",
13
"email": "[email protected]"
14
}
15
},
16
{
17
"node": {
18
"name": "Ned Stark",
19
"email": "[email protected]"
20
}
21
}
22
]
23
}
24
},
25
{
26
"label": "Lannister",
27
"color": "#2F80EDFF",
28
"students": {
29
"edges": [
30
{
31
"node": {
32
"name": "Jaime Lannister",
33
"email": "[email protected]"
34
}
35
}
36
]
37
}
38
}
39
]
40
}
41
}
42
}
Copied!

Participant tags

Tags can also be queried from the Participant model. The Participant.tags field lists all the tags the student was assigned within the course.
Tags can only be applied to students so other participant types will have a null value when querying for the Participant.tags field. For students, the API will always return a list.
Query
Response
1
{
2
course(id: "00000000-5945-95c7-65fc-a9747b200320") {
3
participants {
4
edges {
5
node {
6
user {
7
name
8
}
9
participantType
10
tags {
11
label
12
color
13
}
14
}
15
}
16
}
17
}
18
}
Copied!
1
{
2
"data": {
3
"course": {
4
"participants": {
5
"edges": [
6
{
7
"node": {
8
"user": {
9
"name": "Ned Stark"
10
},
11
"participantType": "Owner",
12
"tags": null
13
}
14
},
15
{
16
"node": {
17
"user": {
18
"name": "Arya Stark"
19
},
20
"participantType": "Student",
21
"tags": [
22
{
23
"label": "House Stark",
24
"color": "#EB5757FF"
25
}
26
]
27
}
28
},
29
{
30
"node": {
31
"user": {
32
"name": "Bran Stark"
33
},
34
"participantType": "Student",
35
"tags": [
36
{
37
"label": "House Stark",
38
"color": "#EB5757FF"
39
},
40
{
41
"label": "King of the Six Kingdoms",
42
"color": "#AA1212FF"
43
}
44
]
45
}
46
}
47
]
48
}
49
}
50
}
51
}
Copied!

Mutations

Create tag

You can create tags via the createTag mutation
The tag color should be in #RRGGBBAA format
Mutation
Response
1
mutation {
2
createTag(
3
courseId: "00000000-5945-95c7-65fc-a9747b200320",
4
label: "Westeros",
5
color: "#A32533AB"
6
) {
7
tag {
8
label
9
color
10
}
11
}
12
}
Copied!
1
{
2
"data": {
3
"createTag": {
4
"tag": {
5
"label": "Westeros",
6
"color": "#112233FF"
7
}
8
}
9
}
10
}
Copied!

Add students to tag

You can add students to a tag via the addStudentsToTag mutation. The mutation returns the updated tag so details like the complete list of students can be fetched. The studentIds are Participant.id values that can be fetched from the Course.participants connection.
Based on the tag id, only student ids from tag's course are accepted
Mutation
Response
1
mutation {
2
addStudentsToTag(
3
tagId: "de1bf57b-aa1d-4736-987e-dc0c4d3620d5",
4
studentIds: ["21b26c40-83ea-43a2-9c4b-f88722e0b9be"]
5
) {
6
tag {
7
label
8
students {
9
edges {
10
node {
11
name
12
}
13
}
14
}
15
}
16
}
17
}
18
Copied!
1
{
2
"data": {
3
"addStudentsToTag": {
4
"tag": {
5
"label": "Westeros",
6
"students": {
7
"edges": [
8
{
9
"node": {
10
"name": "Tyrion Lannister"
11
}
12
},
13
{
14
"node": {
15
"name": "Ser Jorah"
16
}
17
},
18
{
19
"node": {
20
"name": "Hodor"
21
}
22
}
23
]
24
}
25
}
26
}
27
}
28
}
Copied!
Last modified 1mo ago