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
| ############################### | |
| # Stage wkhtmltopdf | |
| FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf | |
| ###################### | |
| # Stage: ruby | |
| FROM ruby:2.5.1-alpine3.7 as ruby | |
| LABEL description="Base ruby image used by other stages" | |
| ###################### |
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 ListRecords($first: Int){ | |
| records(first: $first) { | |
| edges { | |
| node { | |
| 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
| 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 |
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 -> request(query, args) end | |
| next = fn -> nil end | |
| stop = fn -> nil end | |
| Stream.resource(init, next, stop) | |
| end | |
| defp request(query, args) 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 MyApp.StreamPaginator do | |
| def stream(query, args \\ %{first: 100}) do | |
| # ... | |
| next = &next/1 | |
| # ... | |
| 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 MyApp.StreamPaginator do | |
| def stream(query, args \\ %{first: 100}) do | |
| init = fn -> request(query, args) end | |
| next = &next/1 | |
| stop = &Function.identity/1 | |
| Stream.resource(init, next, stop) | |
| end | |
| defp request(query, args) 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
| defp next({nil, _query, _args} = acc), do: {:halt, acc} | |
| defp next({%{"hasNextPage" => false}, _query, _args} = acc), do: {:halt, acc} |
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 { | |
| records(first: 100) { | |
| pageInfo { | |
| hasNextPage | |
| endCursor | |
| } | |
| edges { | |
| node { | |
| 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
| FROM ruby:2.5.1-alpine3.7 | |
| WORKDIR /home/app | |
| RUN apk add --update --no-cache \ | |
| build-base \ | |
| libxml2-dev \ | |
| libxslt-dev \ | |
| nodejs \ | |
| tzdata |
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
| ############################### | |
| # Stage wkhtmltopdf | |
| FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf |
NewerOlder