shamshirz / scoreboard Goto Github PK
View Code? Open in Web Editor NEWIntro to Absinthe & Dataloader
Home Page: https://damp-beach-31852.herokuapp.com/
Intro to Absinthe & Dataloader
Home Page: https://damp-beach-31852.herokuapp.com/
Hey Aaron - thanks for the talk you made at the ElixirConf and making this repo available. I have a quick question about this line here:
scoreboard/lib/scoreboard/games/games.ex
Line 34 in 9d1f811
def query(Score, params) do
params
|> Map.put_new(:limit, 10)
|> Map.put_new(:order, :total)
|> Map.to_list()
|> Enum.reduce(Score, &apply_param/2)
end
def query(queryable, _params), do: queryable
@doc """
reduce function
"""
def apply_param({:limit, num}, queryable), do: queryable |> limit(^num)
def apply_param({:order, field}, queryable), do: queryable |> order_by(desc: ^field)
def apply_param({:player_id, player_id}, queryable), #specifically this pattern
do: queryable |> where(player_id: ^player_id)
Is the player_id
pattern ever matched on in this solution? I ask because I don't see it added to the Map in the query, is the dataloader matching on this function some other way or do you need to specifically hook it up within def query(Score, params)
?
Thanks again.
Means player names will be basically unique ๐คทโโ๏ธ
I still want this to be a live example app for people
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.