Guest User

Untitled

a guest
Jul 17th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. // Define the Feathers schema for service `users`. (Can be re-generated.)
  2. // !code: imports // !end
  3. // !code: init // !end
  4.  
  5. // Define the model using JSON-schema
  6. let schema = {
  7. // !code: schema_header
  8. title: 'Users',
  9. description: 'Users database.',
  10. // !end
  11. // !code: schema_definitions // !end
  12.  
  13. // Required fields.
  14. required: [
  15. // !code: schema_required
  16. 'email',
  17. 'username',
  18. // !end
  19. ],
  20. // Fields with unique values.
  21. uniqueItemProperties: [
  22. // !code: schema_unique // !end
  23. ],
  24.  
  25. // Fields in the model.
  26. properties: {
  27. // !code: schema_properties
  28. id: { type: 'ID' },
  29. username: {},
  30. password: {},
  31. email: {},
  32. // !end
  33. },
  34. // !code: schema_more // !end
  35. };
  36.  
  37. // Define optional, non-JSON-schema extensions.
  38. let extensions = {
  39. // GraphQL generation.
  40. graphql: {
  41. // !<DEFAULT> code: graphql_header
  42. name: 'User',
  43. service: {
  44. sort: { id: 1 },
  45. },
  46. // sql: {
  47. // sqlTable: 'Users',
  48. // uniqueKey: 'id',
  49. // sqlColumn: {
  50. // __authorId__: '__author_id__',
  51. // },
  52. // },
  53. // !end
  54. discard: [
  55. // !code: graphql_discard // !end
  56. ],
  57. add: {
  58. // !<DEFAULT> code: graphql_add
  59. // __author__: { type: '__User__!', args: false, relation: { ourTable: '__authorId__', otherTable: 'id' } },
  60. // !end
  61. },
  62. // !code: graphql_more // !end
  63. },
  64. };
  65.  
  66. // !code: more // !end
  67.  
  68. let moduleExports = {
  69. schema,
  70. extensions,
  71. // !code: moduleExports // !end
  72. };
  73.  
  74. // !code: exports // !end
  75. module.exports = moduleExports;
  76.  
  77. // !code: funcs // !end
  78. // !code: end // !end
Add Comment
Please, Sign In to add comment