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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

array constraint directive: Cannot read properties of undefined (reading 'options')" #216

Open
JannikWempe opened this issue Nov 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JannikWempe
Copy link

JannikWempe commented Nov 27, 2023

Hey,
first of all: thanks for the package 馃檹馃徏

After updating from 5.0.0 to 5.3.0 we saw this error:
Cannot read properties of undefined (reading 'options')"

The error occurs on an array input field like this: tags: [PublishPostTagInput!] @constraint(maxItems: 15)

I have narrowed down this issue to this specific line of code in the update from 5.1.1 (which works fine) to 5.2.0 (which causes the issue): v5.1.1...v5.2.0#diff-92691f7e07d8e0cf1bca1e0dc22e025d109b1b5ba4f16a83bdc05711a670ed5fR233

I don't really get what's going on at that specific line of code. Otherwise I would have attempted to fix it in a PR.

EDIT:

We are instantiating the plugin like this:

createApollo4QueryValidationPlugin({
      schema
    })
@JannikWempe JannikWempe changed the title Cannot read properties of undefined (reading 'options')" array constraint directive: Cannot read properties of undefined (reading 'options')" Nov 27, 2023
@confuser confuser added the bug Something isn't working label Dec 17, 2023
@AlessandroVol23
Copy link

Hey 馃憢馃徑
Is there any update on this? I'd really like to create some custom constraints but I'm unsure how to do it in Apollo 4

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

3 participants