This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PreviewSchemaFilter extends DefaultAstSchemaBuilder[RequestContext] { | |
override def extendObjectType(origin: MatOrigin, | |
existing: ObjectType[RequestContext, _], | |
extensions: List[TypeExtensionDefinition], | |
fields: () => List[Field[RequestContext, Any]], | |
interfaces: List[InterfaceType[RequestContext, Any]], | |
mat: AstSchemaMaterializer[RequestContext]): ObjectType[RequestContext, Any] = { | |
existing.asInstanceOf[ObjectType[RequestContext, Any]].copy(fieldsFn = () => fields().filterNot(_.tags.contains(Preview))) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.xing.one.engine | |
import akka.http.scaladsl.model._ | |
import com.xing.one.GraphqlEngine | |
import com.xing.one.helpers.EngineSpecification | |
import com.xing.one.helpers.Matchers._ | |
class BasicInterfaceSpec extends EngineSpecification { | |
isolated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[error] sangria.parser.SyntaxError: Syntax error while parsing GraphQL query. Invalid input ""/test") {\n}", expected ValueConst, ArgumentConst, DirectiveConst or InputValueDefinition (line 7, column 32): | |
[error] input MyResolver @httpGet(url: "/test") { | |
[error] ^ (QueryParser.scala:433) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Address extends ApiDSL { | |
val t = ApiObjectType( | |
"Address", | |
"A standard container for representing an address", | |
interfaces(Addressable.t), | |
fields( | |
optionalApiField("city", StringType), | |
optionalApiField("province", StringType), | |
optionalApiField("street", StringType), | |
optionalApiField("zip", StringType), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fragment profileFragment on ProfileRef { | |
__typename | |
... on ActiveProfileRef { | |
id | |
firstName | |
lastName | |
} | |
... on InactiveProfileRef { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ProfileRef { | |
val inactiveDefinition = ObjectType( | |
"InactiveProfileRef", | |
"An inactive profile", | |
fields = fields[UserContext, JsObject]( | |
Field("id", IntType, None, resolve = ctx => (ctx.value \ "id").as[Int]) | |
) | |
) | |
val activeDefinition = ObjectType( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val routes = | |
(post & path("graphql")) { | |
optionalHeaderValueByName("ACCEPT_LANGUAGE") { accept_language => | |
entity(as[JsValue]) { requestJson => | |
val context = Context.from(accept_language) | |
println("ACCEPT_LANGUAGE: " + context.language) | |
graphQLEndpoint(requestJson, context) | |
} | |
} | |
} ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@meta_info_version 1 | |
@meta_info_tag 0xcabd | |
@meta_info_device_number 0 | |
@compression_method 0 | |
def pack_info(sequence) do | |
<<@meta_info_tag::big-integer-unsigned-size(16), | |
@compression_method::big-integer-unsigned-size(8), | |
@meta_info_version::integer-unsigned-size(8), | |
@meta_info_device_number::big-integer-unsigned-size(32), | |
zclock_time::big-integer-unsigned-size(64), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Move around the buffer in vim style | |
setw -g mode-keys vi | |
# Shortcuts | |
bind r source-file ~/.tmux.conf\; display "Reloaded!" #reload configuration | |
bind | split-window -h -c '#{pane_current_path}' #split window horizontally | |
bind - split-window -v -c '#{pane_current_path}' #split window vertically | |
bind h select-pane -L #vim style pane navigation | |
bind j select-pane -D #vim style pane navigation | |
bind k select-pane -U #vim style pane navigation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Messages.Time do | |
use Timex | |
alias Timex.DateTime | |
@spec timestamp() :: DateTime.t | |
def timestamp, do: DateTime.now(:utc) | |
@spec timestamp_iso8601() :: String.t | |
@dialyzer {:nowarn_function, timestamp_iso8601: 0} | |
def timestamp_iso8601 do |
NewerOlder