-
Notifications
You must be signed in to change notification settings - Fork 106
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
Passing large schema in as string causes pattern too long error #2046
Comments
Hi, could you create a reproduction, or share your schema? |
Hey @dimaMachina I am working on it, Accidentally submitted before wrapping up and I am editing it now |
@dimaMachina I have updated the bug with a description. I will see if I can put a sandbox together as an example. Our schema cannot be shared but I think I can create a similar way to reproduce if it would help |
@cernst11 thank you, some reproduction will be very helpful |
Hey @dimaMachina I have created an example here. I simplified our code down to the bare minimum and generated a mock schema. I have also updated the original description |
@cernst11 so the error says where value We'll try to find a way to fix it! |
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
When passing a large schema of over 8kb as a string instead of file path the loader attempts to pattern match the raw string and will throw and eslint pattern too long error.
To Reproduce Steps to reproduce the behavior:
Programatically extend and call the ESLint class and load the schema as a string into
parserOptions
. Next use the lintText method of the class to lint the GraphQL schema subset against the entire schema. Here an error will be thrown about the pattern being too long.An example can be found and ran here. To run the example in the terminal run
npm start
From here the following error message will be displayed
Environment:
@graphql-eslint/eslint-plugin
: 3.20.1Additional context
This appears to be worked around in version 4 of the linter here by building the schema differently in the browser for use in the playground.
The text was updated successfully, but these errors were encountered: