GraphQL API and utilities for the rpdata project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.4 KiB

  1. # The Query type represents the read entry points into the API.
  2. type Query {
  3. # Find character by either an ID or a nick.
  4. character(id: String, nick: String): Character
  5. # Find characters by either a list of ids, nicks or an author. Only one parameter at a time
  6. characters(ids: [String!], nicks: [String!], author: String): [Character!]!
  7. # Find channel by name
  8. channel(name: String!): Channel
  9. # Find all channels. Specifying `logged: true` restricts the search to only logged.
  10. channels(logged: Boolean): [Channel!]!
  11. # Find log by ID
  12. log(id: String): Log
  13. # Find logs by a list of IDs
  14. logs(input: LogQueryInput): [LogHeader!]!
  15. # Find post by ID
  16. post(id: String!): Post
  17. # Find posts by IDs. It's meant to allow other parts of the UI to link to a cluster of posts, e.g. for a room description for the
  18. # Mapp should it ever become a thing.
  19. posts(ids: [String!]!): [Post!]!
  20. # Find file by ID
  21. file(id: String!): File
  22. # Files get all available files. If includePublic is set, it will return public files as well
  23. files(includePublic: Boolean, mimeTypes: [String!]): [File!]!
  24. # Find current session
  25. session: Session!
  26. }
  27. # The Mutation type represents write entry points into the API.
  28. type Mutation {
  29. # Add a new character
  30. addCharacter(input: CharacterAddInput!): Character!
  31. # Add nick to character
  32. addCharacterNick(input: CharacterNickInput!): Character!
  33. # Remove nick from character
  34. removeCharacterNick(input: CharacterNickInput!): Character!
  35. # Edit character
  36. editCharacter(input: CharacterEditInput!): Character!
  37. # Remove a character
  38. removeCharacter(id: String!): Character!
  39. # Add a channel
  40. addChannel(input: ChannelAddInput!): Channel!
  41. # Edit a channel
  42. editChannel(input: ChannelEditInput!): Channel!
  43. # Remove a channel
  44. removeChannel(name: String!): Channel!
  45. # Add a new log
  46. addLog(input: LogAddInput!): Log!
  47. # Edit a log
  48. editLog(input: LogEditInput!): Log!
  49. # Remove a log
  50. removeLog(id: String!): Log!
  51. # Add a post
  52. addPost(input: AddPostInput!): Post!
  53. # Edit a post
  54. editPost(input: EditPostInput!): Post!
  55. # Move a post
  56. movePost(input: MovePostInput!): Post!
  57. # Remove a post
  58. removePost(id: String!): Post!
  59. # Edit a file
  60. editFile(input: EditFileInput!): File!
  61. # Remove a file
  62. removeFile(id: String!): File
  63. # Log in
  64. login(username: String!, password: String!): Session!
  65. # Log out
  66. logout(): Session!
  67. }
  68. schema {
  69. query: Query
  70. mutation: Mutation
  71. }