Last active
April 13, 2020 10:02
-
-
Save gottfrois/e73c8805a2e25eae9094ac1d4bd00c0f to your computer and use it in GitHub Desktop.
Code snippet in Stream Paginated GraphQL API in Elixir medium blog post
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 MyApp.StreamPaginator do | |
def stream(query, args \\ %{first: 100}) do | |
init = fn -> end | |
next = fn -> end | |
stop = fn -> end | |
Stream.resource(init, next, stop) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment