ash-project / ash_graphql

The extension for building GraphQL APIs with Ash
https://hexdocs.pm/ash_graphql
MIT License
73 stars 49 forks source link

fix: don't deduplicate argument types by argument name #162

Closed rbino closed 5 months ago

rbino commented 5 months ago

As mentioned in the upgrade guide, the point of dropping auto generation of types was to avoid conflicts when two arguments had the same name but different types. Now that we require explicit generation, we can actually support that usecase for, e.g., arguments with the same name but different types in create/update mutations.

Contributor checklist

rbino commented 5 months ago

Drafted to check if we have to deduplicate for type instead, now that we removed deduplication for name

zachdaniel commented 5 months ago

Looks great! Merge when ready 😁

zachdaniel commented 5 months ago

Oh, interesting...I think we deduplicate in type name somewhere already? There are definitely already cases where people reuse the same enum/new type and it doesn't cause issues.

rbino commented 5 months ago

I'm hitting this: if I define a NewType with both graphql_type and graphql_input_type (with different types) and I use both (the first as a calculation output type, the second as argument input), Absinthe complains that the type is duplicate.

I'm checking to see if I can reproduce this in a test case.

rbino commented 5 months ago

So the duplication thing is actually orthogonal to this (I'm opening an issue about it), so this can be merged

zachdaniel commented 5 months ago

🚀 Thank you for your contribution! 🚀