# Juniper Relay Connections
[](https://crates.io/crates/placeholder)
[](https://docs.rs/placeholder)
[](https://github.com/dyedgreen/juniper-relay/actions/workflows/ci.yml)
[](./LICENSE)
Relay style pagination for Juniper.
This library provides the a `RelayConnection` struct, which can be returned in a Juniper GraphQL
schema and implements the [relay connection interface][spec].
## Example
```rust
#[derive(GraphQLObject)]
struct Foo {
id: i32,
}
impl RelayConnectionNode for Foo {
type Cursor = i32;
fn cursor(&self) -> Self::Cursor {
self.id
}
fn connection_type_name() -> &'static str {
"FooConnection"
}
fn edge_type_name() -> &'static str {
"FooConnectionEdge"
}
}
let edges: Vec<Foo> = run_query(sql);
Ok(edges)
})
```
[spec]: https://relay.dev/graphql/connections.htm