Skip to content

Instantly share code, notes, and snippets.

@danielrearden
Last active May 15, 2020 04:08
Show Gist options
  • Save danielrearden/cf7e9edd3e484b88521591121721d95e to your computer and use it in GitHub Desktop.
Save danielrearden/cf7e9edd3e484b88521591121721d95e to your computer and use it in GitHub Desktop.
Making GraphQL Magic with Sqlmancer - 3
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