From 182bedcfafff7c8292651f743e5efab47fd49ab7 Mon Sep 17 00:00:00 2001 From: Riccardo Binetti Date: Wed, 31 Jan 2024 23:02:58 +0100 Subject: [PATCH] chore: enable non-null mutation arguments in tests --- config/config.exs | 1 + test/create_test.exs | 2 +- test/destroy_test.exs | 10 +++++----- test/update_test.exs | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config/config.exs b/config/config.exs index ea4325c7..dee34a92 100644 --- a/config/config.exs +++ b/config/config.exs @@ -6,6 +6,7 @@ config :ash, :validate_api_resource_inclusion?, false config :ash, :validate_api_config_inclusion?, false config :ash_graphql, :default_managed_relationship_type_name_template, :action_name +config :ash_graphql, :allow_non_null_mutation_arguments?, true if Mix.env() == :dev do config :git_ops, diff --git a/test/create_test.exs b/test/create_test.exs index 22790bea..3e10dd85 100644 --- a/test/create_test.exs +++ b/test/create_test.exs @@ -376,7 +376,7 @@ defmodule AshGraphql.CreateTest do test "a create with a managed relationship works with many_to_many and [on_lookup: :relate, on_match: :relate]" do resp = """ - mutation CreatePostWithCommentsAndTags($input: CreatePostWithCommentsAndTagsInput) { + mutation CreatePostWithCommentsAndTags($input: CreatePostWithCommentsAndTagsInput!) { createPostWithCommentsAndTags(input: $input) { result{ text diff --git a/test/destroy_test.exs b/test/destroy_test.exs index 52a05177..c101b2d9 100644 --- a/test/destroy_test.exs +++ b/test/destroy_test.exs @@ -14,7 +14,7 @@ defmodule AshGraphql.DestroyTest do resp = """ - mutation DeletePost($id: ID) { + mutation DeletePost($id: ID!) { deletePost(id: $id) { result{ text @@ -42,7 +42,7 @@ defmodule AshGraphql.DestroyTest do resp = """ - mutation ArchivePost($id: ID) { + mutation ArchivePost($id: ID!) { deletePost(id: $id) { result{ text @@ -96,7 +96,7 @@ defmodule AshGraphql.DestroyTest do resp = """ - mutation DeleteWithError($id: ID) { + mutation DeleteWithError($id: ID!) { deletePostWithError(id: $id) { result{ text @@ -128,7 +128,7 @@ defmodule AshGraphql.DestroyTest do test "destroying a non-existent record returns a not found error" do resp = """ - mutation DeletePost($id: ID) { + mutation DeletePost($id: ID!) { deletePost(id: $id) { result{ text @@ -162,7 +162,7 @@ defmodule AshGraphql.DestroyTest do resp = """ - mutation DeletePost($id: ID) { + mutation DeletePost($id: ID!) { deletePostWithError(id: $id) { result{ text diff --git a/test/update_test.exs b/test/update_test.exs index 760219df..d02223f1 100644 --- a/test/update_test.exs +++ b/test/update_test.exs @@ -19,7 +19,7 @@ defmodule AshGraphql.UpdateTest do resp = """ - mutation UpdatePost($id: ID, $input: UpdatePostInput) { + mutation UpdatePost($id: ID!, $input: UpdatePostInput) { updatePost(id: $id, input: $input) { result{ text @@ -209,7 +209,7 @@ defmodule AshGraphql.UpdateTest do resp = """ - mutation UpdatePostConfirm($input: UpdatePostConfirmInput, $id: ID) { + mutation UpdatePostConfirm($input: UpdatePostConfirmInput, $id: ID!) { updatePostConfirm(input: $input, id: $id) { result{ text @@ -253,7 +253,7 @@ defmodule AshGraphql.UpdateTest do resp = """ - mutation UpdatePostConfirm($input: UpdatePostConfirmInput, $id: ID) { + mutation UpdatePostConfirm($input: UpdatePostConfirmInput, $id: ID!) { updatePostConfirm(input: $input, id: $id) { result{ text