Skip to content

Examples

Learn from complete, working examples that demonstrate common patterns. All examples are part of the monorepo and can be run directly.

Terminal window
# Clone the repository
git clone https://github.com/nrf110/effect-gql.git
# Install dependencies
pnpm install
# Build all packages first
pnpm build
# Run an example
pnpm example:basic # Basic server
pnpm example:dataloaders # DataLoader example
pnpm example:subscriptions # Real-time subscriptions
pnpm example:full # Full-featured example

Each example is a self-contained package in the examples/ directory:

examples/
├── basic-server/ # Minimal getting-started example
│ ├── package.json
│ ├── tsconfig.json
│ └── src/
│ └── index.ts
├── dataloaders/ # N+1 problem solution
├── subscriptions/ # Real-time updates
└── full-featured/ # Production patterns
└── src/
├── domain.ts # Effect Schema models
├── services.ts # Business logic services
├── loaders.ts # DataLoader definitions
├── schema.ts # GraphQL schema
└── index.ts # Server entry point
ExampleQueriesMutationsSubscriptionsServicesDataLoaders
Basic Server
DataLoaders
Subscriptions
Full-Featured