Documentation Index
Fetch the complete documentation index at: https://docs.pylon.mortgage/llms.txt
Use this file to discover all available pages before exploring further.
Variables
Variables allow you to pass dynamic values to your queries and mutations, making them reusable.
Using variables
Define variables in your query and pass them separately:
query GetDeal($id: ID!) {
deal(id: $id) {
id
status
}
}
Variables:
Variable types
GraphQL supports various variable types:
ID! - Required ID
String - Optional string
Int - Integer
Float - Floating point number
Boolean - True/false
- Custom input types
Example with multiple variables
query GetDeals($first: Int, $status: DealStatus) {
deals(first: $first, status: $status) {
id
status
}
}
Variables:
{
"first": 10,
"status": "ACTIVE"
}
Fragments
Fragments allow you to reuse field selections across multiple queries.
Basic fragment
fragment BorrowerFields on Borrower {
id
firstName
lastName
email
}
query GetDeal {
deal(id: "123") {
id
borrowers {
...BorrowerFields
}
}
}
Multiple fragments
You can use multiple fragments in a single query:
fragment BorrowerFields on Borrower {
id
firstName
lastName
}
fragment IncomeFields on Income {
statedMonthlyAmount
payPeriodFrequency
}
query GetDeal {
deal(id: "123") {
id
borrowers {
...BorrowerFields
incomes {
...IncomeFields
}
}
}
}
Inline fragments
Use inline fragments for union types or interfaces:
query GetLoan {
loan(id: "123") {
id
... on ConventionalLoan {
loanAmount
ltv
}
... on JumboLoan {
loanAmount
jumboLimit
}
}
}
Best practices
- Use variables for dynamic values - Never hardcode IDs or filters
- Create reusable fragments - Define common field selections once
- Name fragments descriptively - Use clear, descriptive names
- Keep fragments focused - Don’t create overly large fragments
Common patterns
Reusable borrower fragment
fragment BorrowerDetails on Borrower {
id
firstName
lastName
email
phoneNumber
incomes {
statedMonthlyAmount
payPeriodFrequency
}
assets {
amount
institutionName
}
}
Using in multiple queries
query GetDeal($id: ID!) {
deal(id: $id) {
id
borrowers {
...BorrowerDetails
}
}
}
query GetBorrower($id: ID!) {
borrower(id: $id) {
...BorrowerDetails
}
}