Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cryptic warning when generating an input with not fields #223

Open
rgraff opened this issue Oct 6, 2024 · 0 comments
Open

Cryptic warning when generating an input with not fields #223

rgraff opened this issue Oct 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rgraff
Copy link

rgraff commented Oct 6, 2024

Describe the bug
When you have an input resource with no fields, you get a cryptic warning:

warning: Embedded type MyApp.SomeUnionType.SomeSubType does not have an input type defined, but is accepted as input in at least one location.
  (ash_graphql 1.3.2) lib/resource/resource.ex:4296: AshGraphql.Resource.do_field_type/5
  (ash_graphql 1.3.2) lib/resource/resource.ex:3293: anonymous fn/4 in AshGraphql.Resource.union_type_definitions/6
  (elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
  (ash_graphql 1.3.2) lib/resource/resource.ex:3287: AshGraphql.Resource.union_type_definitions/6
  (elixir 1.17.2) lib/enum.ex:4353: Enum.flat_map_list/2
  (elixir 1.17.2) lib/enum.ex:4354: Enum.flat_map_list/2

To Reproduce
In my particular instance, I was scaffolding out a new UnionType and its various SubTypes but I hadn't defined any attributes yet and had an empty accepts

Expected behavior
A warning that says it can't define an input type without at least one input attribute.

** Runtime

  • Elixir version
  • Erlang version
  • OS
  • Ash version
  • any related extension versions

Additional context
Add any other context about the problem here.

@rgraff rgraff added the bug Something isn't working label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant