Like
mutation do
field :new_account, :account do
arg(:icloud_id, non_null(:string), name: "iCloudID") # <--- :name
resolve(&Accounts.create/3)
end
end
but this particular approach doesn’t seem to work.
Like
mutation do
field :new_account, :account do
arg(:icloud_id, non_null(:string), name: "iCloudID") # <--- :name
resolve(&Accounts.create/3)
end
end
but this particular approach doesn’t seem to work.
arg(:“iCloudID”, non_null(:string))
I would want to keep it as :icloud_id
and not :iCloudID
in elixir.
It probably want work since then snake_case
halper would produce a different result on an incoming request ("iCloudID"
-> :i_cloud_id
).
If however absinthe had a lookup table of elixir atoms <-> camelcased graphql names, then it could work.
Providing a :name
does work for fields though …
# doesn't work with args
iex(5)> Absinthe.Type.Argument.build [icloud_id: [type: :string, name: "iCloudID"]]
{:%{}, [],
[
icloud_id: {:%, [],
[
{:__aliases__, [alias: false], [:Absinthe, :Type, :Argument]},
{:%{}, [], [deprecation: nil, name: "icloud_id", type: :string]}
]}
]}
# but works with fields
iex(6)> Absinthe.Type.Field.build [icloud_id: [type: :string, name: "iCloudID"]]
{:%{}, [],
[
icloud_id: {:%, [],
[
{:__aliases__, [alias: false], [:Absinthe, :Type, :Field]},
{:%{}, [],
[
deprecation: nil,
identifier: :icloud_id,
type: :string,
name: "iCloudID",
middleware: [],
args: {:%{}, [], []}
]}
]}
]}
How are field names them de-camelized? Why "iCloudID"
from above turns into :icloud_id
and not :i_cloud_id
?