diff --git a/lib/radiator_web/channels/user_socket.ex b/lib/radiator_web/channels/user_socket.ex index 81a0b1f1..d09ccb92 100644 --- a/lib/radiator_web/channels/user_socket.ex +++ b/lib/radiator_web/channels/user_socket.ex @@ -1,6 +1,6 @@ defmodule RadiatorWeb.UserSocket do use Phoenix.Socket - use Absinthe.Phoenix.Socket, schema: RadiatorWeb.Schema + use Absinthe.Phoenix.Socket, schema: RadiatorWeb.GraphQL.Schema ## Channels # channel "room:*", RadiatorWeb.RoomChannel diff --git a/lib/radiator_web/resolvers/directory.ex b/lib/radiator_web/graphql/resolvers/directory.ex similarity index 99% rename from lib/radiator_web/resolvers/directory.ex rename to lib/radiator_web/graphql/resolvers/directory.ex index c84ac739..931caf90 100644 --- a/lib/radiator_web/resolvers/directory.ex +++ b/lib/radiator_web/graphql/resolvers/directory.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Resolvers.Directory do +defmodule RadiatorWeb.GraphQL.Resolvers.Directory do alias Radiator.Directory alias Radiator.Directory.{Episode, Podcast, Network} alias Radiator.EpisodeMeta diff --git a/lib/radiator_web/resolvers/editor.ex b/lib/radiator_web/graphql/resolvers/editor.ex similarity index 86% rename from lib/radiator_web/resolvers/editor.ex rename to lib/radiator_web/graphql/resolvers/editor.ex index 256a52ac..0e81ed07 100644 --- a/lib/radiator_web/resolvers/editor.ex +++ b/lib/radiator_web/graphql/resolvers/editor.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Resolvers.Editor do +defmodule RadiatorWeb.GraphQL.Resolvers.Editor do alias Radiator.Directory.Editor def create_network(_parent, %{network: args}, %{context: %{authenticated_user: user}}) do diff --git a/lib/radiator_web/resolvers/session.ex b/lib/radiator_web/graphql/resolvers/session.ex similarity index 93% rename from lib/radiator_web/resolvers/session.ex rename to lib/radiator_web/graphql/resolvers/session.ex index 6f89924a..98911cc0 100644 --- a/lib/radiator_web/resolvers/session.ex +++ b/lib/radiator_web/graphql/resolvers/session.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Resolvers.Session do +defmodule RadiatorWeb.GraphQL.Resolvers.Session do def get_authenticated_session( _parent, %{username_or_email: username_or_email, password: password}, diff --git a/lib/radiator_web/resolvers/storage.ex b/lib/radiator_web/graphql/resolvers/storage.ex similarity index 95% rename from lib/radiator_web/resolvers/storage.ex rename to lib/radiator_web/graphql/resolvers/storage.ex index 2cbec9a9..2cc9ed9b 100644 --- a/lib/radiator_web/resolvers/storage.ex +++ b/lib/radiator_web/graphql/resolvers/storage.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Resolvers.Storage do +defmodule RadiatorWeb.GraphQL.Resolvers.Storage do alias Radiator.Storage alias Radiator.Media alias Radiator.Directory diff --git a/lib/radiator_web/schema.ex b/lib/radiator_web/graphql/schema.ex similarity index 92% rename from lib/radiator_web/schema.ex rename to lib/radiator_web/graphql/schema.ex index 2673249c..c1d7a457 100644 --- a/lib/radiator_web/schema.ex +++ b/lib/radiator_web/graphql/schema.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema do +defmodule RadiatorWeb.GraphQL.Schema do use Absinthe.Schema def plugins do @@ -31,14 +31,14 @@ defmodule RadiatorWeb.Schema do import_types Absinthe.Type.Custom import_types Absinthe.Plug.Types - import_types RadiatorWeb.Schema.Directory.EpisodeTypes - import_types RadiatorWeb.Schema.DirectoryTypes - import_types RadiatorWeb.Schema.StorageTypes - import_types RadiatorWeb.Schema.MediaTypes - import_types RadiatorWeb.Schema.UserTypes - - alias RadiatorWeb.Resolvers - alias RadiatorWeb.Schema.Middleware, as: RadiatorWebMiddleware + import_types RadiatorWeb.GraphQL.Schema.Directory.EpisodeTypes + import_types RadiatorWeb.GraphQL.Schema.DirectoryTypes + import_types RadiatorWeb.GraphQL.Schema.StorageTypes + import_types RadiatorWeb.GraphQL.Schema.MediaTypes + import_types RadiatorWeb.GraphQL.Schema.UserTypes + + alias RadiatorWeb.GraphQL.Resolvers + alias RadiatorWeb.GraphQL.Schema.Middleware, as: RadiatorWebMiddleware query do @desc "Get all podcasts" diff --git a/lib/radiator_web/schema/directory_types.ex b/lib/radiator_web/graphql/schema/directory_types.ex similarity index 96% rename from lib/radiator_web/schema/directory_types.ex rename to lib/radiator_web/graphql/schema/directory_types.ex index 5e1126fc..1299e71f 100644 --- a/lib/radiator_web/schema/directory_types.ex +++ b/lib/radiator_web/graphql/schema/directory_types.ex @@ -1,9 +1,9 @@ -defmodule RadiatorWeb.Schema.DirectoryTypes do +defmodule RadiatorWeb.GraphQL.Schema.DirectoryTypes do use Absinthe.Schema.Notation import Absinthe.Resolution.Helpers - alias RadiatorWeb.Resolvers + alias RadiatorWeb.GraphQL.Resolvers @desc "A network" object :network do diff --git a/lib/radiator_web/schema/episode_types.ex b/lib/radiator_web/graphql/schema/episode_types.ex similarity index 76% rename from lib/radiator_web/schema/episode_types.ex rename to lib/radiator_web/graphql/schema/episode_types.ex index 4721d906..5e945b60 100644 --- a/lib/radiator_web/schema/episode_types.ex +++ b/lib/radiator_web/graphql/schema/episode_types.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.Directory.EpisodeTypes do +defmodule RadiatorWeb.GraphQL.Schema.Directory.EpisodeTypes do use Absinthe.Schema.Notation @desc "A chapter in an episode" diff --git a/lib/radiator_web/schema/media_types.ex b/lib/radiator_web/graphql/schema/media_types.ex similarity index 77% rename from lib/radiator_web/schema/media_types.ex rename to lib/radiator_web/graphql/schema/media_types.ex index 4c3227ee..23e19919 100644 --- a/lib/radiator_web/schema/media_types.ex +++ b/lib/radiator_web/graphql/schema/media_types.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.MediaTypes do +defmodule RadiatorWeb.GraphQL.Schema.MediaTypes do use Absinthe.Schema.Notation @desc "An audio enclosure" diff --git a/lib/radiator_web/schema/middleware/require_authentication.ex b/lib/radiator_web/graphql/schema/middleware/require_authentication.ex similarity index 80% rename from lib/radiator_web/schema/middleware/require_authentication.ex rename to lib/radiator_web/graphql/schema/middleware/require_authentication.ex index d8a324e1..93bdc861 100644 --- a/lib/radiator_web/schema/middleware/require_authentication.ex +++ b/lib/radiator_web/graphql/schema/middleware/require_authentication.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.Middleware.RequireAuthentication do +defmodule RadiatorWeb.GraphQL.Schema.Middleware.RequireAuthentication do @behaviour Absinthe.Middleware def call(resolution, _) do diff --git a/lib/radiator_web/schema/middleware/translate_changeset.ex b/lib/radiator_web/graphql/schema/middleware/translate_changeset.ex similarity index 89% rename from lib/radiator_web/schema/middleware/translate_changeset.ex rename to lib/radiator_web/graphql/schema/middleware/translate_changeset.ex index 0266ac93..89b11cbd 100644 --- a/lib/radiator_web/schema/middleware/translate_changeset.ex +++ b/lib/radiator_web/graphql/schema/middleware/translate_changeset.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.Middleware.TranslateChangeset do +defmodule RadiatorWeb.GraphQL.Schema.Middleware.TranslateChangeset do @behaviour Absinthe.Middleware def call(%Absinthe.Resolution{errors: errors} = resolution, _config) diff --git a/lib/radiator_web/schema/storage_types.ex b/lib/radiator_web/graphql/schema/storage_types.ex similarity index 85% rename from lib/radiator_web/schema/storage_types.ex rename to lib/radiator_web/graphql/schema/storage_types.ex index 0f809592..47ca4f60 100644 --- a/lib/radiator_web/schema/storage_types.ex +++ b/lib/radiator_web/graphql/schema/storage_types.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.StorageTypes do +defmodule RadiatorWeb.GraphQL.Schema.StorageTypes do use Absinthe.Schema.Notation @desc "Intermediary object providing an URL to upload against" diff --git a/lib/radiator_web/schema/user_types.ex b/lib/radiator_web/graphql/schema/user_types.ex similarity index 74% rename from lib/radiator_web/schema/user_types.ex rename to lib/radiator_web/graphql/schema/user_types.ex index 34d5c338..e1a71863 100644 --- a/lib/radiator_web/schema/user_types.ex +++ b/lib/radiator_web/graphql/schema/user_types.ex @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.UserTypes do +defmodule RadiatorWeb.GraphQL.Schema.UserTypes do use Absinthe.Schema.Notation @desc "A user API session" diff --git a/lib/radiator_web/router.ex b/lib/radiator_web/router.ex index e39f4410..7b87c046 100644 --- a/lib/radiator_web/router.ex +++ b/lib/radiator_web/router.ex @@ -81,7 +81,7 @@ defmodule RadiatorWeb.Router do scope "/api" do pipe_through :api - forward "/graphql", Absinthe.Plug, schema: RadiatorWeb.Schema - forward "/graphiql", Absinthe.Plug.GraphiQL, schema: RadiatorWeb.Schema + forward "/graphql", Absinthe.Plug, schema: RadiatorWeb.GraphQL.Schema + forward "/graphiql", Absinthe.Plug.GraphiQL, schema: RadiatorWeb.GraphQL.Schema end end diff --git a/test/radiator_web/schema/mutation/episodes_test.exs b/test/radiator_web/graphql/schema/mutation/episodes_test.exs similarity index 99% rename from test/radiator_web/schema/mutation/episodes_test.exs rename to test/radiator_web/graphql/schema/mutation/episodes_test.exs index 9213609a..b5b2428e 100644 --- a/test/radiator_web/schema/mutation/episodes_test.exs +++ b/test/radiator_web/graphql/schema/mutation/episodes_test.exs @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.EpisodeControllerTest.Schema.Mutation.EpisodesTest do +defmodule RadiatorWeb.GraphQL.Schema.Mutation.EpisodesTest do use RadiatorWeb.ConnCase, async: true import Radiator.Factory diff --git a/test/radiator_web/schema/mutation/networks_test.exs b/test/radiator_web/graphql/schema/mutation/networks_test.exs similarity index 98% rename from test/radiator_web/schema/mutation/networks_test.exs rename to test/radiator_web/graphql/schema/mutation/networks_test.exs index fff6c907..eece9aef 100644 --- a/test/radiator_web/schema/mutation/networks_test.exs +++ b/test/radiator_web/graphql/schema/mutation/networks_test.exs @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.Mutation.NetworksTest do +defmodule RadiatorWeb.GraphQL.Schema.Mutation.NetworksTest do use RadiatorWeb.ConnCase, async: true import Radiator.Factory diff --git a/test/radiator_web/schema/mutation/podcasts_test.exs b/test/radiator_web/graphql/schema/mutation/podcasts_test.exs similarity index 98% rename from test/radiator_web/schema/mutation/podcasts_test.exs rename to test/radiator_web/graphql/schema/mutation/podcasts_test.exs index cbdca88e..cc81d0f2 100644 --- a/test/radiator_web/schema/mutation/podcasts_test.exs +++ b/test/radiator_web/graphql/schema/mutation/podcasts_test.exs @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.EpisodeControllerTest.Schema.Mutation.PodcastsTest do +defmodule RadiatorWeb.GraphQL.Schema.Mutation.PodcastsTest do use RadiatorWeb.ConnCase, async: true import Radiator.Factory diff --git a/test/radiator_web/schema/mutation/upload_test.exs b/test/radiator_web/graphql/schema/mutation/upload_test.exs similarity index 96% rename from test/radiator_web/schema/mutation/upload_test.exs rename to test/radiator_web/graphql/schema/mutation/upload_test.exs index 74e24510..9585c08f 100644 --- a/test/radiator_web/schema/mutation/upload_test.exs +++ b/test/radiator_web/graphql/schema/mutation/upload_test.exs @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.EpisodeControllerTest.Schema.Mutation.UploadTest do +defmodule RadiatorWeb.GraphQL.Schema.Mutation.UploadTest do use RadiatorWeb.ConnCase, async: true import Radiator.Factory diff --git a/test/radiator_web/schema/mutation/users_test.exs b/test/radiator_web/graphql/schema/mutation/users_test.exs similarity index 93% rename from test/radiator_web/schema/mutation/users_test.exs rename to test/radiator_web/graphql/schema/mutation/users_test.exs index 0b9a34ef..f6aa729d 100644 --- a/test/radiator_web/schema/mutation/users_test.exs +++ b/test/radiator_web/graphql/schema/mutation/users_test.exs @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.Mutation.UsersTest do +defmodule RadiatorWeb.GraphQL.Schema.Mutation.UsersTest do use RadiatorWeb.ConnCase, async: true @request_session_query """ diff --git a/test/radiator_web/schema/query/episodes_test.exs b/test/radiator_web/graphql/schema/query/episodes_test.exs similarity index 97% rename from test/radiator_web/schema/query/episodes_test.exs rename to test/radiator_web/graphql/schema/query/episodes_test.exs index d529638d..bfe4405e 100644 --- a/test/radiator_web/schema/query/episodes_test.exs +++ b/test/radiator_web/graphql/schema/query/episodes_test.exs @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.EpisodeControllerTest.Schema.Query.EpisodesTest do +defmodule RadiatorWeb.GraphQL.Schema.Query.EpisodesTest do use RadiatorWeb.ConnCase, async: true import Radiator.Factory diff --git a/test/radiator_web/schema/query/networks_test.exs b/test/radiator_web/graphql/schema/query/networks_test.exs similarity index 97% rename from test/radiator_web/schema/query/networks_test.exs rename to test/radiator_web/graphql/schema/query/networks_test.exs index 3b803c61..e3fb4702 100644 --- a/test/radiator_web/schema/query/networks_test.exs +++ b/test/radiator_web/graphql/schema/query/networks_test.exs @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.Schema.Query.NetworksTest do +defmodule RadiatorWeb.GraphQL.Schema.Query.NetworksTest do use RadiatorWeb.ConnCase, async: true import Radiator.Factory diff --git a/test/radiator_web/schema/query/podcasts_test.exs b/test/radiator_web/graphql/schema/query/podcasts_test.exs similarity index 97% rename from test/radiator_web/schema/query/podcasts_test.exs rename to test/radiator_web/graphql/schema/query/podcasts_test.exs index cf5d79dd..7e645bc9 100644 --- a/test/radiator_web/schema/query/podcasts_test.exs +++ b/test/radiator_web/graphql/schema/query/podcasts_test.exs @@ -1,4 +1,4 @@ -defmodule RadiatorWeb.EpisodeControllerTest.Schema.Query.PodcastsTest do +defmodule RadiatorWeb.GraphQL.Schema.Query.PodcastsTest do use RadiatorWeb.ConnCase, async: true import Radiator.Factory