Skip to content

Commit

Permalink
refactor: move all graphql modules into GraphQL namespace
Browse files Browse the repository at this point in the history
closes #34
  • Loading branch information
eteubert committed May 5, 2019
1 parent 87ae654 commit 7bb12ac
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion lib/radiator_web/channels/user_socket.ex
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule RadiatorWeb.Resolvers.Storage do
defmodule RadiatorWeb.GraphQL.Resolvers.Storage do
alias Radiator.Storage
alias Radiator.Media
alias Radiator.Directory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule RadiatorWeb.Schema do
defmodule RadiatorWeb.GraphQL.Schema do
use Absinthe.Schema

def plugins do
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule RadiatorWeb.Schema.MediaTypes do
defmodule RadiatorWeb.GraphQL.Schema.MediaTypes do
use Absinthe.Schema.Notation

@desc "An audio enclosure"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule RadiatorWeb.Schema.Middleware.RequireAuthentication do
defmodule RadiatorWeb.GraphQL.Schema.Middleware.RequireAuthentication do
@behaviour Absinthe.Middleware

def call(resolution, _) do
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule RadiatorWeb.Schema.UserTypes do
defmodule RadiatorWeb.GraphQL.Schema.UserTypes do
use Absinthe.Schema.Notation

@desc "A user API session"
Expand Down
4 changes: 2 additions & 2 deletions lib/radiator_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 """
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7bb12ac

Please sign in to comment.