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

Bug: Fails for nest list of non_null #9

Open
kirega opened this issue Mar 29, 2024 · 1 comment
Open

Bug: Fails for nest list of non_null #9

kirega opened this issue Mar 29, 2024 · 1 comment

Comments

@kirega
Copy link
Contributor

kirega commented Mar 29, 2024

Steps to reproduce

When a field has the following definitions, the library will through an error

field :test, :test do 
      arg(:ids, non_null(list_of(non_null(:id))), directives: [constraints: [format: "uuid"]])
end

Error

Invalid constraints for field/arg ids of type %Absinthe.Blueprint.TypeReference.NonNull{of_type: %Absinthe.Blueprint.TypeReference.List{of_type: %Absinthe.Blueprint.TypeReference.NonNull{of_type: :string, errors: []}, errors: []}, errors: []}: [:format]

@DReigada
Copy link
Contributor

DReigada commented Apr 8, 2024

Thank you for reporting this.

Constraints for elements of a list are not yet implemented:

# TODO: We could also validate the items inside lists with other constraints.

Currently the only constraints the library supports for lists are about the list itself and not its items (min_length and max_length).

We would like to implement this eventually, and PRs are always welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants