Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

Sangria

sangria-graphql.github.io

  • Free plan
  • API
  • Self-hosted

What Sangria is

Sangria is a free, self-hosted Scala implementation of GraphQL for building servers and endpoints inside a Scala application. It leaves transport, data format, and storage decisions to that application. Scala abstractions define schemas, types, fields, and resolvers, while macros can derive GraphQL object types from Scala classes and allow customization. Sangria parses and validates queries, including a macro that reports syntax errors during compilation. Its Executor runs queries against a schema and can receive user context for shared data or authorization information. Query analysis includes complexity checks and schema comparisons. Middleware can support performance measurement, metrics, and security enforcement at field or query level. Example integrations cover Akka HTTP and Play Framework. JSON integrations include Circe, spray-json, Play JSON, Argonaut, json4s, MessagePack, and Amazon Ion. The project describes compatibility with Apollo, Relay, GraphiQL, and other GraphQL tools, with sangria-relay for React Relay. Authentication and authorization are implemented through application context, resolvers, middleware, and field tags.

Who it suits

Sangria is for Scala developers building self-hosted GraphQL servers and endpoints. It fits teams that want GraphQL capabilities while retaining control of transport, storage, and application security.

Good to know, and what to watch

  • Scala abstractions define GraphQL schemas and resolvers
  • Compile-time query syntax checking macro
  • Executor supports schema queries and user context
  • Complexity checks and schema comparisons
  • Integrations for frameworks and JSON libraries
  • Self-hosted deployment is required
  • No explicit security primitives are provided
  • Transport and storage remain application responsibilities

The verdict

Sangria supplies broad GraphQL server functionality in a Scala library, including execution, validation, analysis, middleware, and integrations. Applications must provide deployment, transport, storage, and authentication choices.

What the maker publishes

Audience
The getting-started guide describes Sangria as a layer inside a Scala application for building a GraphQL server while leaving transport, data format, and storage choices to the application. source
Authentication
The documentation says Sangria does not provide explicit security primitives and demonstrates implementing authentication and authorization through application context, resolvers, middleware, and field tags. source
Client compatibility
The project describes Sangria as spec compliant and compatible with Apollo, Relay, GraphiQL, and other GraphQL tools and libraries. source
Code generation
Macros can derive GraphQL object type definitions from Scala classes and customize generated types. source
Contributions
Users are invited to report bugs through the issue tracker and contribute code or documentation through pull requests. source
Execution
Its Executor runs queries against a schema and can use a user context object for shared data or authorization information. source
Framework examples
The project provides example server integrations using Akka HTTP and Play Framework. source
Integrations
The project says Sangria is spec compliant and works with Apollo, Relay, GraphiQL, and other GraphQL tools and libraries. source
Intended users
The documentation presents Sangria as a library for Scala developers building GraphQL servers and endpoints. source
JSON libraries
Sangria supports multiple JSON libraries, including Circe, spray-json, and Play JSON. source
JSON support
The documentation lists marshalling integrations for spray-json, Play JSON, Circe, Argonaut, json4s, MessagePack, and Amazon Ion. source
License
The Sangria repository states that the project is licensed under Apache License 2.0. source
Middleware
Sangria middleware can support performance measurement, metrics collection, and security enforcement at field and query level. source
Product
Sangria is a Scala implementation of GraphQL. source
Purpose
Sangria is a Scala implementation of GraphQL. source
Query analysis
It supports query and schema validation, query complexity checks, and schema comparisons. source
Query execution
Its Executor runs GraphQL queries against a schema and user context. source
Query parsing
Sangria parses GraphQL queries and offers a macro that reports syntax errors at compile time. source
Relay support
The sangria-relay library is offered for using Sangria with the React Relay framework. source
Schema definition
It provides Scala abstractions for defining GraphQL schemas, types, fields, and resolvers. source
Support
The community page directs users to Stack Overflow for help and Gitter for general discussion. source

Checked against the maker's pages on 8 Oct 2026.