2021-05-06 10:27:04 +00:00
|
|
|
defmodule Mobilizon.GraphQL.Schema.Users.PushSubscription do
|
|
|
|
@moduledoc """
|
|
|
|
Schema representation for PushSubscription
|
|
|
|
"""
|
|
|
|
use Absinthe.Schema.Notation
|
|
|
|
alias Mobilizon.GraphQL.Resolvers.PushSubscription
|
|
|
|
|
2021-05-06 16:39:59 +00:00
|
|
|
# object :push_subscription do
|
|
|
|
# field(:id, :id)
|
|
|
|
# end
|
2021-05-06 10:27:04 +00:00
|
|
|
|
2021-05-06 16:39:59 +00:00
|
|
|
# @desc "A paginated list of subscriptions"
|
|
|
|
# object :paginated_push_subscription_list do
|
|
|
|
# field(:elements, list_of(:push_subscription), description: "A list of push subscriptions")
|
|
|
|
# field(:total, :integer, description: "The total number of push subscriptions in the list")
|
|
|
|
# end
|
|
|
|
|
|
|
|
# object :push_queries do
|
|
|
|
# field :list_push_subscriptions, :paginated_push_subscription_list do
|
|
|
|
# resolve(&PushSubscription.list_user_push_subscriptions/3)
|
|
|
|
# end
|
|
|
|
# end
|
2021-05-06 10:27:04 +00:00
|
|
|
|
|
|
|
object :push_mutations do
|
2021-05-06 16:39:59 +00:00
|
|
|
field :register_push, :string do
|
2021-05-06 10:27:04 +00:00
|
|
|
arg(:endpoint, non_null(:string))
|
2021-05-06 16:39:59 +00:00
|
|
|
arg(:auth, non_null(:string))
|
|
|
|
arg(:p256dh, non_null(:string))
|
2021-05-06 10:27:04 +00:00
|
|
|
resolve(&PushSubscription.register_push_subscription/3)
|
|
|
|
end
|
|
|
|
|
2021-05-06 16:39:59 +00:00
|
|
|
field :unregister_push, :string do
|
|
|
|
arg(:endpoint, non_null(:string))
|
2021-05-06 10:27:04 +00:00
|
|
|
resolve(&PushSubscription.unregister_push_subscription/3)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|