sangria

Scala GraphQL implementation

License

License

GroupId

GroupId

org.sangria-graphql
ArtifactId

ArtifactId

sangria_2.11
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

sangria
Scala GraphQL implementation
Project Organization

Project Organization

org.sangria-graphql
Source Code Management

Source Code Management

https://github.com/sangria-graphql/sangria.git

Download sangria_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/org.sangria-graphql/sangria_2.11/ -->
<dependency>
    <groupId>org.sangria-graphql</groupId>
    <artifactId>sangria_2.11</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.sangria-graphql/sangria_2.11/
implementation 'org.sangria-graphql:sangria_2.11:2.0.1'
// https://jarcasting.com/artifacts/org.sangria-graphql/sangria_2.11/
implementation ("org.sangria-graphql:sangria_2.11:2.0.1")
'org.sangria-graphql:sangria_2.11:jar:2.0.1'
<dependency org="org.sangria-graphql" name="sangria_2.11" rev="2.0.1">
  <artifact name="sangria_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.sangria-graphql', module='sangria_2.11', version='2.0.1')
)
libraryDependencies += "org.sangria-graphql" % "sangria_2.11" % "2.0.1"
[org.sangria-graphql/sangria_2.11 "2.0.1"]

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
org.parboiled : parboiled_2.11 jar 2.1.8
org.sangria-graphql : macro-visit_2.11 jar 0.1.2
org.sangria-graphql : sangria-marshalling-api_2.11 jar 1.0.4
org.sangria-graphql : sangria-streaming-api_2.11 jar 1.0.1
org.scala-lang : scala-reflect jar 2.11.12

test (10)

Group / Artifact Type Version
co.fs2 : fs2-core_2.11 jar 2.1.0
org.scalatest : scalatest_2.11 jar 3.2.2
org.sangria-graphql : sangria-marshalling-testkit_2.11 jar 1.0.3
org.sangria-graphql : sangria-spray-json_2.11 jar 1.0.2
org.sangria-graphql : sangria-argonaut_2.11 jar 1.0.1
org.sangria-graphql : sangria-ion_2.11 jar 2.0.0
org.sangria-graphql : sangria-monix_2.11 jar 2.0.0
eu.timepit : refined_2.11 jar 0.9.12
net.jcazevedo : moultingyaml_2.11 jar 0.4.2
io.github.classgraph : classgraph jar 4.8.78

Project Modules

There are no modules declared in this project.

Sangria Logo

Sangria is a scala GraphQL library.

Build Status Coverage Status Maven Central License Scaladocs Join the chat at https://gitter.im/sangria-graphql/sangria

SBT Configuration:

libraryDependencies += "org.sangria-graphql" %% "sangria" % "2.0.0"

You can find an example application that uses akka-http with sangria here:

https://github.com/sangria-graphql/sangria-akka-http-example

More info and the documentation can be found in the project home page:

https://sangria-graphql.github.io/

I would also recommend you to check out Sangria Playground. It is an example of GraphQL server written with Play framework and Sangria. It also serves as a playground, where you can interactively execute GraphQL queries and play with some examples.

If you want to use sangria with react-relay framework, then you also may be interested in sangria-relay.

Sangria is a spec compliant GraphQL implementation, so it works out of the box with Apollo, Relay, GraphiQL and other GraphQL tools and libraries.

Hello World Example

In this example we will use circe JSON marshalling, so we also need to include following dependency:

libraryDependencies += "org.sangria-graphql" %% "sangria-circe" % "1.2.1"

The most simple Hello World application might look like this:

import sangria.schema._
import sangria.execution._
import sangria.macros._
import sangria.marshalling.circe._
import scala.concurrent.ExecutionContext.Implicits.global

val QueryType = ObjectType("Query", fields[Unit, Unit](
  Field("hello", StringType, resolve = _ => "Hello world!")
))

val schema = Schema(QueryType)

val query = graphql"{ hello }"

val result = Executor.execute(schema, query)

result.foreach(res => println(res.spaces2))

this example will print following result JSON:

{
  "data" : {
    "hello" : "Hello world!"
  }
}

For more complex example, I would recommend you to check out the Getting Started Tutorial.

Issues, Bugs, Ideas

If you've got some interesting ideas to share or discovered a nasty bug, feel free to use Sangria's issue tracker. Also feel free to fork project and create the pull requests - they are highly appreciated!

If you are facing an issue and not sure what would be the best way to describe it, the I would recommend you to use this minimal gist as a template.

StackOverflow

In case you need some help or support, then you can use StackOverflow for this. When you are asking a question, be sure to add scala, graphql and sangria tags, so that other people can easily find them.

Gitter & Mailing List

For more general, lengthy discussions or pretty much anything else please join us in the gitter chat and google groups.

Contribute

If you like the project and would like to support it or contribute to it, then you are very welcome to do so. You can spread the word and tweet about the project or even better - create a small blog post, video, example project and show how you use sangria and GraphQL. I'm pretty sure it would be interesting for many people.

Also you can contribute to the documentation or help others by answering questions on StackOverflow or joining discussions at the mailing list and gitter chat. It would be very helpful!

Not to mention the code itself. There is nothing more exciting than hacking some stuff together :) So please feel free to materialize your ideas in form of code and send pull requests!

License

Sangria is licensed under Apache License, Version 2.0.

org.sangria-graphql

Sangria

Sangria - Scala GraphQL implementation

Versions

Version
2.0.1
2.0.0
2.0.0-RC2
2.0.0-RC1
2.0.0-M4
2.0.0-M3
2.0.0-M2
2.0.0-M1
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
1.0.0-RC5
1.0.0-RC4
1.0.0-RC3
1.0.0-RC2
1.0.0-RC1
0.7.3
0.7.2
0.7.1
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.2.2
0.2.1
0.2.0