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

Using "uniqueTypeName: Int" behalves unexpected #98

Open
simlu opened this issue May 30, 2022 · 2 comments
Open

Using "uniqueTypeName: Int" behalves unexpected #98

simlu opened this issue May 30, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@simlu
Copy link
Contributor

simlu commented May 30, 2022

When using limit: Int @constraint(uniqueTypeName: "Int", min: 1, max: 200),
I would expect the validation to still run. However no errors are generated.

Is this expected behavior? Is this something this library should support?

I get that conceptually there could be two types of "Int" (one with a constraint and one without) - which goes a little against the graphql schema logic. Consider throwing an assert maybe?

I'm honestly not sure what the correct path of action is here

@confuser confuser added the question Further information is requested label Jun 3, 2022
@confuser
Copy link
Owner

confuser commented Jun 3, 2022

Yes, this is expected. The validation won't run in this case; as the name suggests it needs to be a unique name. Under the hood, this module auto generates a unique type for anything decorated with the directive.

The correct action would be to throw an error if it's a type name which already exists

@simlu
Copy link
Contributor Author

simlu commented Jun 3, 2022

@confuser OK thank you for the reply! Should this issue be labeled improvement then?

@confuser confuser added enhancement New feature or request and removed question Further information is requested labels Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants