Skip to content

Commit

Permalink
Merge pull request #1303 from michaelcaterisano/mc/fix-camelize-direc…
Browse files Browse the repository at this point in the history
…tives

Fix #1302, camelize type system directives in sdl output
  • Loading branch information
benwilson512 authored Feb 29, 2024
2 parents 747ba05 + b77a879 commit 5a97423
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/absinthe/schema/notation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,6 @@ 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
Expand Down
6 changes: 0 additions & 6 deletions test/absinthe/schema/sdl_render_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,6 @@ defmodule Absinthe.Schema.SdlRenderTest do
on :field
end

directive :foo_foo do
on :field
end

enum :order_status do
value :delivered
value :processing
Expand Down Expand Up @@ -248,8 +244,6 @@ defmodule Absinthe.Schema.SdlRenderTest do
query: RootQueryType
}
directive @fooFoo on FIELD
directive @foo(baz: String) on FIELD
\"Escaped\\t\\\"descrição\\/description\\\"\"
Expand Down
8 changes: 6 additions & 2 deletions test/absinthe/schema/type_system_directive_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ defmodule Absinthe.Schema.TypeSystemDirectiveTest do
:input_field_definition
]
end

directive :camel_case_me do
on [:field_definition]
end
end

defmodule TypeSystemDirectivesSdlSchema do
Expand Down Expand Up @@ -110,7 +114,7 @@ defmodule Absinthe.Schema.TypeSystemDirectiveTest do
directive :feature, name: ":field_definition"
end

field :sweet, :sweet_scalar
field :sweet, :sweet_scalar, directives: [:camel_case_me]
field :which, :category
field :pet, :dog

Expand Down Expand Up @@ -190,7 +194,7 @@ defmodule Absinthe.Schema.TypeSystemDirectiveTest do
type RootQueryType {
post: Post @feature(name: \":field_definition\")
sweet: SweetScalar
sweet: SweetScalar @camelCaseMe
which: Category
pet: Dog
search(filter: SearchFilter @feature(name: \":argument_definition\")): SearchResult @feature(name: \":argument_definition\")
Expand Down

0 comments on commit 5a97423

Please sign in to comment.