Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Proposed Lead Data
- Given the opaque nature of JSON data the following could work nicely as an alternative allowing effective introspection.
- ```gql
- type Lead {
- ...
- data: LeadData
- }
- interface LeadData {
- firstName: String
- lastName: String
- email: String
- phone: String
- }
- type Buyer implements LeadData {
- firstName: String
- lastName: String
- email: String
- phone: String
- }
- type Seller implements LeadData {
- firstName: String
- lastName: String
- email: String
- phone: String
- address: String
- city: String
- state: String
- zip: String
- numBedrooms: Integer
- numBathrooms: Integer
- }
- ```
- This would allow us to query like so:
- ```gql
- query {
- lead(nodeId: "123") {
- data {
- firstName
- lastName
- email
- phone
- }
- ... on Seller {
- address
- city
- }
- }
- }
- ```
Add Comment
Please, Sign In to add comment