{"id":31789200,"url":"https://github.com/solution10/juniper-relay-helpers","last_synced_at":"2026-01-20T17:38:02.944Z","repository":{"id":317192163,"uuid":"1066344826","full_name":"solution10/juniper-relay-helpers","owner":"solution10","description":"!!WIP - experiement!!!: Rust crate for making working with Relay's GraphQL spec additions easier.","archived":false,"fork":false,"pushed_at":"2025-10-03T10:57:22.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-03T12:21:32.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solution10.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-29T11:04:02.000Z","updated_at":"2025-10-03T10:57:25.000Z","dependencies_parsed_at":"2025-10-03T12:21:57.090Z","dependency_job_id":"4bd2dc32-9237-4e4c-8287-50dae55b9471","html_url":"https://github.com/solution10/juniper-relay-helpers","commit_stats":null,"previous_names":["solution10/graphql-relay-helpers","solution10/juniper-relay-helpers"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/solution10/juniper-relay-helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solution10%2Fjuniper-relay-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solution10%2Fjuniper-relay-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solution10%2Fjuniper-relay-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solution10%2Fjuniper-relay-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solution10","download_url":"https://codeload.github.com/solution10/juniper-relay-helpers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solution10%2Fjuniper-relay-helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002686,"owners_count":26083442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-10T14:48:30.771Z","updated_at":"2025-10-10T14:48:32.834Z","avatar_url":"https://github.com/solution10.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Juniper Relay GraphQL spec helpers\n\n[![⚒️ Build and test](https://github.com/solution10/graphql-relay-helpers/actions/workflows/branch-test.yml/badge.svg)](https://github.com/solution10/graphql-relay-helpers/actions/workflows/branch-test.yml)\n[![crates.io](https://img.shields.io/crates/v/juniper_relay_helpers)](https://crates.io/crates/juniper_relay_helpers)\n[![docs.rs](https://docs.rs/juniper_relay_helpers/badge.svg)](https://docs.rs/juniper_relay_helpers)\n\nCrate providing helpers for implementing the [Relay GraphQL spec](https://relay.dev/docs/guides/graphql-server-specification/).\n\n- [Quick Tour](#quick-tour)\n- [Documentation](#documentation)\n- [Example App](#example-app)\n- [Contributing](#contributing)\n- [Authors](#authors)\n\n## Quick Tour\n\nHere's a super quick taster of what this crate can do for you!\n\n(These examples are illustrative; see the [Example App](#example-app) and [Documentation](https://docs.rs/juniper_relay_helpers) for the real deal).\n\n```rust\nuse juniper_relay_helpers::{RelayConnection};\n\n// Add the `RelayConnection` derive macro to your type to get some fancy additional structs:\n\n#[derive(RelayConnection)]\nstruct User {\n    name: String,\n}\n\n// UserRelayConnection and UserRelayEdge are generated for you 🎉\n\n// -------------\n\n// Now cursors are a PITA, wouldn't it be nice if we have some helpers for that?\n\nuse juniper_relay_helpers::{OffsetCursor};\n\n// Build a cursor that represents a SQL-like offset + limit:\nlet offset_cursor = OffsetCursor::new(100, Some(10));\n\n// Build a cursor that's just a raw string from something like Dynamo or an external system:\nlet string_cursor = StringCursor::new(\"some-string-cursor\");\n\n// These cursors are implemented as GraphQL scalars, so you can use them in your query arguments, and use them in\n// response payloads!\n\n// --------------\n\n// Relay identifiers need to be unique across all types. The crate provides a helper struct to generate these, with\n// type information encoded into them!\n\nuse juniper_relay_helpers::{RelayIdentifier, IdentiferTypeDiscriminator};\n\n// First define your entity types:\n#[derive(IdentiferTypeDiscriminator)]\nenum MyEntityTypes {\n  Character\n}\n\n// And then you can generate Relay identifiers:\nlet identifier = RelayIdentifier::new(123, MyEntityTypes::Character);\n\n// The `RelayIdentifier` type is also implemented as a GraphQL scalar, so you can use it in responses and it is output\n// with the `ID` GraphQL type, perfect for Relay!\n\n// --------------\n\n// Tying it all together:\nuse juniper_relay_helpers::{\n  OffsetCursor,\n  OffsetCursorProvider,\n  IdentiferTypeDiscriminator,\n  PageRequest,\n  RelayIdentifier\n};\n\n#[derive(IdentiferTypeDiscriminator)]\nenum MyEntityTypes {\n  Character\n}\n\n#[derive(GraphQLObject, RelayConnection)]\nstruct User {\n  id: RelayIdentifier\u003cUUID, MyEntityTypes\u003e,\n  name: String\n}\nimpl From\u003cUserRow\u003e for User {\n  fn from(row: UserRow) -\u003e Self {\n    Self {\n      id: RelayIdentifier::new(row.id, MyEntityTypes::Character),\n      name: row.name,\n    }\n  }\n}\n\nimpl QueryRoot {\n  fn users(\u0026self, first: Option\u003ci32\u003e, after: Option\u003cOffsetCursor\u003e,  context: \u0026Context) -\u003e FieldResult\u003cConnection\u003cUser\u003e\u003e {\n    let user_result = fetch_users_from_db(context, first, after.offset);\n    \n    Ok(UserRelayConnection::new(\n      user_result.rows.map(|row| User.from(row)),\n      user_result.total_count,\n      OffsetCursorProvider::new(),\n      Some(PageRequest::new(first, after))\n    ))\n  }\n}\n\n```\n\n## Documentation\n\nThe crate aims for a high degree of documentation, so you can find all the details at\n[https://docs.rs/juniper_relay_helpers](https://docs.rs/juniper_relay_helpers).\n\n## Example App\n\nThere's nothing like seeing things in action! This repo contains an example Axum \u0026 Juniper application that uses\nthis crate to implement a Relay compliant server. Check out [/juniper_relay_helpers_test](/juniper_relay_helpers_test)\na toy GraphQL server that uses this crate and is the basis of the integration tests.\n\n## Contributing\n\nContributions are welcome! Please see the [Contributing Guide](CONTRIBUTING.md) for more details.\n\n## Authors\n\n- Alex Gisby: (https://github.com/solution10)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolution10%2Fjuniper-relay-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolution10%2Fjuniper-relay-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolution10%2Fjuniper-relay-helpers/lists"}