Skip to content

Instantly share code, notes, and snippets.

View dashared's full-sized avatar
🫐

Darya Rednikina dashared

🫐
View GitHub Profile
@dashared
dashared / Controller.scala
Last active December 1, 2023 03:22
Custom action which works with file upload, PlayFramework scala, GraphQL
package controllers.graphql
import com.google.inject.{Inject, Singleton}
import keycloak.{GraphQLAction, Upload, VerifiedToken}
import models.graphql.GraphQL
import models.graphql.error.{AuthenticationException, ContentException, NotFoundByIDException, PermissionException}
import models.graphql.schemas.context.SangriaContext
import play.api.libs.json.{JsObject, JsString, Json}
import play.api.mvc.{AbstractController, Action, AnyContent, ControllerComponents, Request, Result}
import sangria.marshalling.playJson._