Skip to main content

GraphQL API Reference

Welcome to the comprehensive Prospyr GraphQL API reference. This documentation is automatically generated from our GraphQL schema.

Overview

The Prospyr API uses GraphQL, a query language that allows you to request exactly the data you need. All API access is through a single endpoint:

https://prod.prospyrmedapi.com/v1/graphql

Key Concepts

Operations

GraphQL supports three types of operations:

  • Queries - Fetch data from the API
  • Mutations - Create, update, or delete data
  • Subscriptions - Real-time updates via WebSocket

Type System

Our API uses a strongly-typed schema:

  • Object Types - Core data models (Patient, Appointment, Provider, etc.)
  • Input Types - Types used for mutations and filtering
  • Enums - Predefined sets of values
  • Scalars - Basic data types (String, Int, Date, etc.)

Common Patterns

Filtering

Most queries support filtering through where arguments:

query FilteredPatients {
patient(where: {
age: { _gte: 18 },
city: { _eq: "New York" }
}) {
id
firstName
lastName
}
}

Pagination

Use limit and offset for pagination:

query PaginatedResults {
appointment(
limit: 20,
offset: 40,
order_by: { startTime: desc }
) {
id
startTime
}
}

Relationships

Navigate relationships in a single query:

query PatientWithAppointments {
patient_by_pk(id: 123) {
id
firstName
appointments {
id
startTime
provider {
firstName
lastName
}
}
}
}

Aggregations

Get counts and other aggregates:

query CountPatients {
patient_aggregate(where: { isActive: { _eq: true } }) {
aggregate {
count
avg {
age
}
}
}
}

Best Practices

  1. Request Only What You Need - GraphQL allows you to specify exact fields
  2. Use Fragments - Reuse common field selections across queries
  3. Batch Operations - Combine multiple queries in a single request
  4. Handle Errors - Check the errors array in responses
  5. Use Variables - Never hardcode values in queries

Schema Exploration

You can explore the schema interactively using:

  • GraphQL Playground - Available at the API endpoint
  • Introspection Queries - Query the schema itself
  • Postman Collection - Pre-built queries and mutations

Getting Help