This file contains hidden or 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 Blog do | |
def fetch(limit, offset \\ 0) do | |
IO.inspect(limit: limit, offset: offset) | |
posts = 1..1000 |> Enum.map(fn i -> %{body: "body #{i}"} end) | |
%{ | |
total_count: length(posts), | |
posts: posts |> Enum.slice(offset || 0, limit) | |
} | |
end |
This file contains hidden or 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
query { | |
user(id: "12345") { | |
id | |
} | |
viewer { | |
user { | |
id | |
} | |
} | |
} |
This file contains hidden or 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 :user do | |
field :id, non_null(:id) | |
end | |
object :group do | |
field :id, non_null(:id) | |
field :members, list_of(:user) | |
end | |
query do |
This file contains hidden or 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 Schema do | |
use Absinthe.Schema | |
object :user do | |
field :id, non_null(:id) | |
end | |
object :viewer do | |
field :user, non_null(:user) do | |
resolve(fn _parent, _args, _ctx -> |
This file contains hidden or 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 NhlGraphApi.NhlApi do | |
def data() do | |
Dataloader.KV.new(&fetch/2) | |
end | |
def fetch(_batch_key, arg_maps) do | |
IO.inspect(arg_maps: arg_maps) | |
%{%{id: "1"} => %{id: 1, name: "foo", city: "bar", abbreviation: "OMG"}} | |
end | |
end |
This file contains hidden or 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 ApiWeb.Schema do | |
use Absinthe.Schema | |
import Absinthe.Resolution.Helpers | |
import_types Absinthe.Type.Custom | |
@desc "A user" | |
object :user do | |
field :id, non_null(:string) |
This file contains hidden or 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.reststopperpro.android.activity; | |
import android.Manifest; | |
import android.content.pm.PackageManager; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v4.app.ActivityCompat; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; |
This file contains hidden or 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.mygdx.game.screen; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.InputMultiplexer; | |
import com.badlogic.gdx.InputProcessor; | |
import com.badlogic.gdx.Screen; | |
import com.badlogic.gdx.graphics.GL20; | |
import com.badlogic.gdx.scenes.scene2d.Stage; | |
import com.badlogic.gdx.utils.viewport.FitViewport; | |
import com.badlogic.gdx.utils.viewport.Viewport; |
This file contains hidden or 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
$ winecfg | |
wine: created the configuration directory '/home/smoak/.wine' | |
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046} | |
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa} | |
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002 | |
err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002 | |
err:ole:get_local_server_stream Failed: 80004002 | |
err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046} | |
err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa} | |
err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002 |
This file contains hidden or 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.mygdx.game; | |
import com.badlogic.gdx.ApplicationAdapter; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.graphics.GL20; | |
import com.badlogic.gdx.graphics.OrthographicCamera; | |
import com.badlogic.gdx.graphics.Texture; | |
import com.badlogic.gdx.graphics.g2d.*; | |
import com.badlogic.gdx.maps.MapLayers; | |
import com.badlogic.gdx.maps.tiled.TiledMap; |
NewerOlder