Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sangria jackson marshalling.

Build Status

Not yet released.

Usage

Create marshalling support with your instance of ObjectMapper

package com.example

object Jackson {
  val marshalling = com.wix.sangria.marshalling.jackson.forObjectMapper(objectMapper)
}

Import marshalling._ where you need to use it. ToInput instances are automatically derived for all types. FromInput instances have to be declared manually:

package com.example

import marshalling._

object FromInputs {
  implicit def articleFromInput = jacksonFromInput[Article]
}

Note: It's up to you to make sure that the object mapper can serialize and deserialize values in the format defined in the graphql schema. This means that you probably need to use the [jackson-scala-module][https://github.com/FasterXML/jackson-module-scala] and annotate enum values inside case classes with [@JsonScalaEnumeration][https://github.com/FasterXML/jackson-module-scala/wiki/Enumerations] annotations.

License

sangria-json4s-jackson is licensed under Apache License, Version 2.0.

About

Sangria Jackson marshalling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages