Skip to content

Capitalized field names yields bad error message #298

Open
@bjornarg

Description

@bjornarg

Defining a field with a capitalized name does not work, but the error message still suggests using the capitalized name when attempting to query it.

query do
    field :Foo, type: :string, resolve: fn
      _, _ -> {:ok, "Bar"}
    end
end

When running the query query {Foo} this returns:

{
  "errors": [
    {
      "message": "Cannot query field \"Foo\" on type \"RootQueryType\". Did you mean \"Foo\"?",
      "locations": [
        {
          "line": 1,
          "column": 0
        }
      ]
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions