Browse Source

Remove unused addRelay mutation

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
chapril^2^2
Thomas Citharel 2 months ago
parent
commit
05724476aa
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
  1. 9
      js/src/graphql/admin.ts
  2. 9
      lib/graphql/resolvers/admin.ex
  3. 7
      lib/graphql/schema/admin.ex
  4. 6
      schema.graphql

9
js/src/graphql/admin.ts

@ -131,15 +131,6 @@ export const ADD_INSTANCE = gql`
${INSTANCE_FRAGMENT}
`;
export const ADD_RELAY = gql`
mutation addRelay($address: String!) {
addRelay(address: $address) {
...relayFragment
}
}
${RELAY_FRAGMENT}
`;
export const REMOVE_RELAY = gql`
mutation removeRelay($address: String!) {
removeRelay(address: $address) {

9
lib/graphql/resolvers/admin.ex

@ -511,15 +511,6 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
end
end
@spec create_relay(any(), map(), Absinthe.Resolution.t()) ::
{:ok, Follower.t()} | {:error, any()}
def create_relay(_parent, %{address: address}, %{context: %{current_user: %User{role: role}}})
when is_admin(role) do
with {:ok, _activity, follow} <- Relay.follow(address) do
{:ok, follow}
end
end
@spec remove_relay(any(), map(), Absinthe.Resolution.t()) ::
{:ok, Follower.t()} | {:error, any()}
def remove_relay(_parent, %{address: address}, %{context: %{current_user: %User{role: role}}})

7
lib/graphql/schema/admin.ex

@ -352,13 +352,6 @@ defmodule Mobilizon.GraphQL.Schema.AdminType do
resolve(&Admin.create_instance/3)
end
@desc "Add a relay subscription"
field :add_relay, type: :follower do
arg(:address, non_null(:string), description: "The relay hostname to add")
resolve(&Admin.create_relay/3)
end
@desc "Delete a relay subscription"
field :remove_relay, type: :follower do
arg(:address, non_null(:string), description: "The relay hostname to delete")

6
schema.graphql

@ -1906,12 +1906,6 @@ type RootMutationType {
domain: String!
): Instance
"Add a relay subscription"
addRelay(
"The relay hostname to add"
address: String!
): Follower
"Delete a relay subscription"
removeRelay(
"The relay hostname to delete"

Loading…
Cancel
Save