schema.graphql 719 Bytes
Newer Older
aleclofabbro's avatar
2  
aleclofabbro committed
1
interface Glyph {
2
  _id: ID!
aleclofabbro's avatar
2  
aleclofabbro committed
3
4
}

aleclofabbro's avatar
aleclofabbro committed
5
# Knows
aleclofabbro's avatar
aleclofabbro committed
6
7
union KnowsSubject = User
union KnowsObject = User
aleclofabbro's avatar
aleclofabbro committed
8

aleclofabbro's avatar
2  
aleclofabbro committed
9
type Knows implements Glyph {
10
  _id: ID!
aleclofabbro's avatar
aleclofabbro committed
11
12
  _subj: [KnowsSubject!]!
  _obj: [KnowsObject!]!
aleclofabbro's avatar
2  
aleclofabbro committed
13
14
}

aleclofabbro's avatar
aleclofabbro committed
15
# Follows
aleclofabbro's avatar
aleclofabbro committed
16
17
union FollowsSubject = User
union FollowsObject = User
18
type Follows implements Glyph {
19
  _id: ID!
aleclofabbro's avatar
aleclofabbro committed
20
21
  _subj: [FollowsSubject!]!
  _obj: [FollowsObject!]!
22
}
aleclofabbro's avatar
2  
aleclofabbro committed
23

aleclofabbro's avatar
aleclofabbro committed
24
# User
25
union UserRelation = Knows | Follows
aleclofabbro's avatar
aleclofabbro committed
26

aleclofabbro's avatar
2  
aleclofabbro committed
27
type User implements Glyph {
28
  _id: ID!
aleclofabbro's avatar
aleclofabbro committed
29
  _rel: [UserRelation!]!
30
  username: String!
aleclofabbro's avatar
2  
aleclofabbro committed
31
}
aleclofabbro's avatar
aleclofabbro committed
32
33
34

# Main

aleclofabbro's avatar
2  
aleclofabbro committed
35
type Query {
aleclofabbro's avatar
aleclofabbro committed
36
  users: [User!]!
aleclofabbro's avatar
2  
aleclofabbro committed
37
38
}

aleclofabbro's avatar
aleclofabbro committed
39
input CreateUserInput {
aleclofabbro's avatar
2  
aleclofabbro committed
40
41
42
  username: String!
}
type Mutation {
43
44
45
  createUser(user: CreateUserInput!): User
  createKnows(from: ID!, to: ID!): Knows
  createFollows(from: ID!, to: ID!): Follows
aleclofabbro's avatar
2  
aleclofabbro committed
46
}