Created
April 27, 2020 18:26
-
-
Save marinho10/d0806466096583ffac76fb7ca2257ce1 to your computer and use it in GitHub Desktop.
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 :accounts_subscriptions do | |
field :accounts_user_count, :integer do | |
config(fn | |
_args, %{context: %{current_user: %{id: user_id}}} -> | |
{:ok, topic: "user_count:#{user_id}"} | |
_args, _context -> | |
{:error, Responses.get(:user_unauthorized)} | |
end) | |
resolve(fn value, _, _res -> | |
{:ok, value} | |
end) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment