Guest User

Untitled

a guest
Oct 12th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. # pho-graphql-v1.1
  2.  
  3. type Facebook implements GraphNode
  4. @permissions(mod: "0x0f751", mask: "0xfffff") # people outside can't read.
  5. {
  6. id: ID,
  7. founder: User!
  8.  
  9. type User implements ActorNode
  10. @edges(
  11. in:"User:Follow, StatusUpdate:Mention, Edges:Consume, Edges:Message",
  12. out:"Post, React, Comment, Consume, Message, Create, Follow"
  13. )
  14. @permissions(mod: "0x07554", mask: "0xfffff") # user themselves, can manage, members can subscribe, outsiders can just read.
  15. @properties(editable: false, volatile: false, revisionable: false)
  16. {
  17. id: ID!,
  18. username: String! @unique @constraints(regex: "/^[_[a-z0-9]]{1,18}$/"),
  19. password: String! @md5 @constraints(regex: "/^[a-zA-Z0-9_]{4,12}$/"),
  20. join_time: Date! @now
  21. birthday: Date @default(String: "01/15/1983"),
  22. about: String @constraints(maxLength: 255,) @default(String: ""),
  23. }
  24.  
  25. type Photo implements ObjectNode
  26. @edges(in:"Edges:Post, Edges:React, Edges:Comment, Edges:Consume")
  27. @permissions(mod: "0x07500", mask: "0xfffff") # owner can write, friends can read and like (subscribe)
  28. @properties(expires: 0, editable: false, volatile: false, revisionable: false)
  29. {
  30. id: ID!,
  31. url: String! @constraints(format: "url"),
  32. create_time: Date! @now
  33. }
  34.  
  35. }
Add Comment
Please, Sign In to add comment