Guest User

Untitled

a guest
Nov 18th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. # Proposed Lead Data
  2.  
  3. Given the opaque nature of JSON data the following could work nicely as an alternative allowing effective introspection.
  4.  
  5. ```gql
  6. type Lead {
  7. ...
  8. data: LeadData
  9. }
  10.  
  11. interface LeadData {
  12. firstName: String
  13. lastName: String
  14. email: String
  15. phone: String
  16. }
  17.  
  18. type Buyer implements LeadData {
  19. firstName: String
  20. lastName: String
  21. email: String
  22. phone: String
  23. }
  24.  
  25. type Seller implements LeadData {
  26. firstName: String
  27. lastName: String
  28. email: String
  29. phone: String
  30.  
  31. address: String
  32. city: String
  33. state: String
  34. zip: String
  35. numBedrooms: Integer
  36. numBathrooms: Integer
  37. }
  38. ```
  39.  
  40. This would allow us to query like so:
  41.  
  42. ```gql
  43. query {
  44. lead(nodeId: "123") {
  45. data {
  46. firstName
  47. lastName
  48. email
  49. phone
  50. }
  51. ... on Seller {
  52. address
  53. city
  54. }
  55. }
  56. }
  57. ```
Add Comment
Please, Sign In to add comment