Skip to content

Commit

Permalink
Merge pull request #825 from maartenvanvliet/issues/argument_sdl_lang…
Browse files Browse the repository at this point in the history
…uage_conventions

Convert argument name in SDL to camelCase
  • Loading branch information
binaryseed authored Dec 14, 2019
2 parents fb09e1a + bee7b44 commit 5ebab90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/absinthe/schema/notation/sdl_render.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ defmodule Absinthe.Schema.Notation.SDL.Render do
)
end

@adapter Absinthe.Adapter.LanguageConventions
defp render(%Blueprint.Schema.InputValueDefinition{} = input_value, type_definitions) do
concat([
string(input_value.name),
string(@adapter.to_external_name(input_value.name, :argument)),
": ",
render(input_value.type, type_definitions),
default(input_value.default_value_blueprint)
])
|> description(input_value.description)
end

@adapter Absinthe.Adapter.LanguageConventions
defp render(%Blueprint.Schema.FieldDefinition{} = field, type_definitions) do
concat([
string(@adapter.to_external_name(field.name, :field)),
Expand Down
3 changes: 3 additions & 0 deletions test/absinthe/schema/sdl_render_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ defmodule SdlRenderTest do
query do
field :echo, :string do
arg :times, :integer, default_value: 10, description: "The number of times"
arg :time_interval, :integer
end
end

Expand All @@ -205,6 +206,8 @@ defmodule SdlRenderTest do
type RootQueryType {
echo(
timeInterval: Int
"The number of times"
times: Int
): String
Expand Down

0 comments on commit 5ebab90

Please sign in to comment.