From 280221c663454729e39b7df1f7aa06f5707cd729 Mon Sep 17 00:00:00 2001 From: Michael Caterisano Date: Sat, 4 Nov 2023 21:19:35 -0400 Subject: [PATCH 1/2] * wrap run docset in async stream * remove oopsies * more whoops camelize directives --- lib/absinthe/schema/notation/sdl_render.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/absinthe/schema/notation/sdl_render.ex b/lib/absinthe/schema/notation/sdl_render.ex index 19a0bbcc82..29770ccf31 100644 --- a/lib/absinthe/schema/notation/sdl_render.ex +++ b/lib/absinthe/schema/notation/sdl_render.ex @@ -257,6 +257,11 @@ defmodule Absinthe.Schema.Notation.SDL.Render do end defp directives(directives, type_definitions) do + directives = + Enum.map(directives, fn directive -> + %{directive | name: Absinthe.Utils.camelize(directive.name, lower: true)} + end) + concat(Enum.map(directives, &render(&1, type_definitions))) end From 3082b12eaf220e8cad36a00c93a02a9f5ff7d76b Mon Sep 17 00:00:00 2001 From: Michael Caterisano Date: Wed, 28 Feb 2024 16:20:32 -0500 Subject: [PATCH 2/2] add test --- lib/absinthe/schema/notation.ex | 1 + test/absinthe/schema/sdl_render_test.exs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/absinthe/schema/notation.ex b/lib/absinthe/schema/notation.ex index 0bd8fe1ec9..538d6381f4 100644 --- a/lib/absinthe/schema/notation.ex +++ b/lib/absinthe/schema/notation.ex @@ -1991,6 +1991,7 @@ defmodule Absinthe.Schema.Notation do defp default_name(Schema.DirectiveDefinition, identifier) do identifier |> Atom.to_string() + |> Absinthe.Utils.camelize(lower: true) end defp default_name(_, identifier) do diff --git a/test/absinthe/schema/sdl_render_test.exs b/test/absinthe/schema/sdl_render_test.exs index 7adc2f5ba2..4a61f410cc 100644 --- a/test/absinthe/schema/sdl_render_test.exs +++ b/test/absinthe/schema/sdl_render_test.exs @@ -208,6 +208,10 @@ defmodule Absinthe.Schema.SdlRenderTest do on :field end + directive :foo_foo do + on :field + end + enum :order_status do value :delivered value :processing @@ -244,6 +248,8 @@ defmodule Absinthe.Schema.SdlRenderTest do query: RootQueryType } + directive @fooFoo on FIELD + directive @foo(baz: String) on FIELD \"Escaped\\t\\\"descrição\\/description\\\"\"