2020-05-02 04:32:56 +12:00
|
|
|
defmodule AshGraphql.MixProject do
|
|
|
|
use Mix.Project
|
|
|
|
|
2020-08-14 10:55:34 +12:00
|
|
|
@description """
|
|
|
|
An absinthe-backed graphql extension for Ash
|
|
|
|
"""
|
|
|
|
|
2024-01-13 08:34:33 +13:00
|
|
|
@version "0.26.9"
|
2020-08-14 10:55:34 +12:00
|
|
|
|
2020-05-02 04:32:56 +12:00
|
|
|
def project do
|
|
|
|
[
|
|
|
|
app: :ash_graphql,
|
2020-08-14 10:55:34 +12:00
|
|
|
version: @version,
|
2021-01-22 17:16:10 +13:00
|
|
|
elixir: "~> 1.11",
|
2020-05-02 04:32:56 +12:00
|
|
|
start_permanent: Mix.env() == :prod,
|
2020-08-14 10:55:34 +12:00
|
|
|
package: package(),
|
|
|
|
aliases: aliases(),
|
|
|
|
deps: deps(),
|
2020-12-02 18:07:15 +13:00
|
|
|
elixirc_paths: elixirc_paths(Mix.env()),
|
2020-09-24 12:54:57 +12:00
|
|
|
dialyzer: [plt_add_apps: [:ash]],
|
2020-08-14 10:55:34 +12:00
|
|
|
test_coverage: [tool: ExCoveralls],
|
|
|
|
preferred_cli_env: [
|
|
|
|
coveralls: :test,
|
|
|
|
"coveralls.github": :test
|
|
|
|
],
|
|
|
|
docs: docs(),
|
|
|
|
description: @description,
|
|
|
|
source_url: "https://github.com/ash-project/ash_graphql",
|
|
|
|
homepage_url: "https://github.com/ash-project/ash_graphql"
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2020-12-02 18:07:15 +13:00
|
|
|
defp elixirc_paths(:test) do
|
|
|
|
elixirc_paths(:dev) ++ ["test/support"]
|
|
|
|
end
|
|
|
|
|
|
|
|
defp elixirc_paths(_) do
|
|
|
|
["lib"]
|
|
|
|
end
|
|
|
|
|
2020-08-14 10:55:34 +12:00
|
|
|
defp docs do
|
|
|
|
[
|
2023-09-16 05:45:12 +12:00
|
|
|
main: "getting-started-with-graphql",
|
2020-08-14 10:55:34 +12:00
|
|
|
source_ref: "v#{@version}",
|
|
|
|
logo: "logos/small-logo.png",
|
|
|
|
extra_section: "GUIDES",
|
2023-10-03 01:35:53 +13:00
|
|
|
before_closing_head_tag: fn type ->
|
|
|
|
if type == :html do
|
|
|
|
"""
|
2023-10-03 03:57:29 +13:00
|
|
|
<script>
|
|
|
|
if (location.hostname === "hexdocs.pm") {
|
|
|
|
var script = document.createElement("script");
|
|
|
|
script.src = "https://plausible.io/js/script.js";
|
|
|
|
script.setAttribute("defer", "defer")
|
|
|
|
script.setAttribute("data-domain", "ashhexdocs")
|
|
|
|
document.head.appendChild(script);
|
|
|
|
}
|
|
|
|
</script>
|
2023-10-03 01:35:53 +13:00
|
|
|
"""
|
|
|
|
end
|
|
|
|
end,
|
2024-01-13 08:53:43 +13:00
|
|
|
extras: [
|
|
|
|
"documentation/tutorials/getting-started-with-graphql.md",
|
|
|
|
"documentation/how_to/authorize-with-graphql.md",
|
|
|
|
"documentation/how_to/handle-errors.md",
|
|
|
|
"documentation/how_to/use-enums-with-graphql.md",
|
|
|
|
"documentation/how_to/use-json-with-graphql.md",
|
|
|
|
"documentation/how_to/use-subscriptions-with-graphql.md",
|
|
|
|
"documentation/how_to/use-unions-with-graphql.md",
|
|
|
|
"documentation/topics/monitoring.md",
|
|
|
|
"documentation/topics/graphql-generation.md",
|
|
|
|
"documentation/topics/modifying-the-resolution.md",
|
|
|
|
"documentation/topics/relay.md",
|
|
|
|
"documentation/dsls/DSL:-AshGraphql.Api.cheatmd",
|
|
|
|
"documentation/dsls/DSL:-AshGraphql.Resource.cheatmd"
|
|
|
|
],
|
|
|
|
groups_for_extras: [
|
|
|
|
Tutorials: ~r'documentation/tutorials',
|
|
|
|
"How To": ~r'documentation/how_to',
|
|
|
|
Topics: ~r'documentation/topics',
|
|
|
|
DSLs: ~r'documentation/dsls'
|
|
|
|
],
|
2023-01-18 19:10:40 +13:00
|
|
|
groups_for_modules: [
|
2023-02-09 16:59:20 +13:00
|
|
|
AshGraphql: [
|
|
|
|
AshGraphql
|
|
|
|
],
|
2023-01-18 19:10:40 +13:00
|
|
|
Introspection: [
|
|
|
|
AshGraphql.Resource.Info,
|
2023-09-16 05:45:12 +12:00
|
|
|
AshGraphql.Api.Info,
|
|
|
|
AshGraphql.Resource,
|
|
|
|
AshGraphql.Api,
|
|
|
|
AshGraphql.Resource.Action,
|
|
|
|
AshGraphql.Resource.ManagedRelationship,
|
|
|
|
AshGraphql.Resource.Mutation,
|
|
|
|
AshGraphql.Resource.Query
|
|
|
|
],
|
|
|
|
Errors: [
|
|
|
|
AshGraphql.Error,
|
|
|
|
AshGraphql.Errors
|
2023-01-18 19:10:40 +13:00
|
|
|
],
|
2023-02-21 14:19:00 +13:00
|
|
|
Miscellaneous: [
|
|
|
|
AshGraphql.Resource.Helpers
|
|
|
|
],
|
2024-01-13 08:34:15 +13:00
|
|
|
Utilities: [
|
|
|
|
AshGraphql.ContextHelpers,
|
|
|
|
AshGraphql.DefaultErrorHandler,
|
|
|
|
AshGraphql.Plug,
|
|
|
|
AshGraphql.Subscription,
|
|
|
|
AshGraphql.Type,
|
|
|
|
AshGraphql.Types.JSON,
|
|
|
|
AshGraphql.Types.JSONString
|
|
|
|
]
|
2023-01-18 19:10:40 +13:00
|
|
|
]
|
2020-08-14 10:55:34 +12:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
defp package do
|
|
|
|
[
|
|
|
|
name: :ash_graphql,
|
|
|
|
licenses: ["MIT"],
|
2022-08-31 13:29:22 +12:00
|
|
|
files: ~w(lib .formatter.exs mix.exs README* LICENSE*
|
|
|
|
CHANGELOG* documentation),
|
2020-08-14 10:55:34 +12:00
|
|
|
links: %{
|
|
|
|
GitHub: "https://github.com/ash-project/ash_graphql"
|
|
|
|
}
|
2020-05-02 04:32:56 +12:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run "mix help compile.app" to learn about applications.
|
|
|
|
def application do
|
|
|
|
[
|
|
|
|
extra_applications: [:logger]
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run "mix help deps" to learn about dependencies.
|
|
|
|
defp deps do
|
|
|
|
[
|
2023-11-14 10:53:21 +13:00
|
|
|
{:ash, ash_version("~> 2.17")},
|
2020-12-01 12:17:00 +13:00
|
|
|
{:absinthe_plug, "~> 1.4"},
|
2022-04-27 03:35:09 +12:00
|
|
|
{:absinthe, "~> 1.7"},
|
2020-08-14 09:39:59 +12:00
|
|
|
{:jason, "~> 1.2"},
|
2023-09-27 16:21:57 +13:00
|
|
|
{:ex_doc, github: "elixir-lang/ex_doc", only: [:dev, :test], runtime: false},
|
2023-09-16 05:45:12 +12:00
|
|
|
{:ex_check, "~> 0.12", only: [:dev, :test]},
|
2023-02-01 17:54:39 +13:00
|
|
|
{:credo, ">= 0.0.0", only: [:dev, :test], runtime: false},
|
|
|
|
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
|
|
|
|
{:sobelow, ">= 0.0.0", only: [:dev, :test], runtime: false},
|
2023-09-16 05:45:12 +12:00
|
|
|
{:git_ops, "~> 2.5", only: [:dev, :test]},
|
|
|
|
{:excoveralls, "~> 0.13", only: [:dev, :test]},
|
2023-05-16 01:39:32 +12:00
|
|
|
{:mix_test_watch, "~> 1.0", only: :dev, runtime: false}
|
2020-05-02 04:32:56 +12:00
|
|
|
]
|
|
|
|
end
|
2020-08-14 09:39:59 +12:00
|
|
|
|
2020-08-26 07:33:11 +12:00
|
|
|
defp ash_version(default_version) do
|
|
|
|
case System.get_env("ASH_VERSION") do
|
|
|
|
nil -> default_version
|
|
|
|
"local" -> [path: "../ash"]
|
2022-05-21 04:28:02 +12:00
|
|
|
"main" -> [git: "https://github.com/ash-project/ash.git"]
|
2020-08-26 07:33:11 +12:00
|
|
|
version -> "~> #{version}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-08-14 10:55:34 +12:00
|
|
|
defp aliases do
|
|
|
|
[
|
|
|
|
sobelow: "sobelow --skip",
|
|
|
|
credo: "credo --strict",
|
2023-09-16 05:45:12 +12:00
|
|
|
docs: [
|
|
|
|
"spark.cheat_sheets",
|
|
|
|
"docs",
|
2023-09-27 16:21:57 +13:00
|
|
|
"spark.replace_doc_links",
|
2023-09-16 05:45:12 +12:00
|
|
|
"spark.cheat_sheets_in_search"
|
|
|
|
],
|
|
|
|
"spark.formatter": "spark.formatter --extensions AshGraphql.Resource,AshGraphql.Api",
|
|
|
|
"spark.cheat_sheets_in_search":
|
|
|
|
"spark.cheat_sheets_in_search --extensions AshGraphql.Resource,AshGraphql.Api",
|
|
|
|
"spark.cheat_sheets": "spark.cheat_sheets --extensions AshGraphql.Resource,AshGraphql.Api"
|
2020-08-14 10:55:34 +12:00
|
|
|
]
|
|
|
|
end
|
|
|
|
end
|