Last active
May 15, 2020 04:08
-
-
Save danielrearden/cf7e9edd3e484b88521591121721d95e to your computer and use it in GitHub Desktop.
Making GraphQL Magic with Sqlmancer - 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Customer @model( | |
table: "customers" | |
pk: "CustomerId" | |
) { | |
id: ID! @col(name: "CustomerId") | |
firstName: String! | |
lastName: String! | |
email: String! | |
invoices: [Invoice!]! | |
@relate(on: { from: "CustomerId", to: "CustomerId" }) | |
} | |
type Invoice @model( | |
table: "invoices" | |
pk: "InvoiceId" | |
) { | |
id: ID! @col(name: "InvoiceId") | |
total: Float! | |
createdOn: String! @col(name: "InvoiceId") | |
customer: Customer | |
@relate(on: { from: "CustomerId", to: "CustomerId" }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment